Skip to content

Commit

Permalink
Update footer and header with portfolio
Browse files Browse the repository at this point in the history
  • Loading branch information
Scc33 committed Jul 2, 2024
1 parent 0ed21c2 commit fe25967
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/components/Footer/Footer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ describe("footer Component", () => {
expect(link.getAttribute("target")).toBe("_blank");
});

it("has correct link to Portfolio", () => {
expect.assertions(2);
const { container } = render(Footer);
const link = container.querySelector(
'a[href="https://portfolio.seancoughlin.me"]'
);
expect(link).toBeTruthy();
expect(link.getAttribute("target")).toBe("_blank");
});

it("has correct link to LinkedIn", () => {
expect.assertions(2);
const { container } = render(Footer);
Expand Down
9 changes: 7 additions & 2 deletions src/components/Header/Header.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ describe("header Component", () => {
});

it("renders all header text with correct text", () => {
expect.assertions(3);
expect.assertions(4);
const { getByText } = render(Header, { y: 0 });
expect(getByText("LinkedIn")).toBeVisible();
expect(getByText("GitHub")).toBeVisible();
expect(getByText("Portfolio")).toBeVisible();
expect(getByText("Blog")).toBeVisible();
});

it("renders all header text with correct links", () => {
expect.assertions(3);
expect.assertions(4);
const { getByText } = render(Header, { y: 0 });
expect(getByText("LinkedIn").closest("a")).toHaveAttribute(
"href",
Expand All @@ -33,6 +34,10 @@ describe("header Component", () => {
"href",
"https://github.com/Scc33"
);
expect(getByText("Portfolio").closest("a")).toHaveAttribute(
"href",
"https://portfolio.seancoughlin.me"
);
expect(getByText("Blog").closest("a")).toHaveAttribute(
"href",
"https://blog.seancoughlin.me"
Expand Down
8 changes: 6 additions & 2 deletions src/data/Links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ interface Links {
const links: Links[] = [
{ name: "Email", url: "mailto:[email protected]" },
{
name: " LinkedIn",
name: "LinkedIn",
url: "https://www.linkedin.com/in/sean-m-coughlin"
},
{
name: " GitHub",
name: "GitHub",
url: "https://github.com/Scc33"
},
{
name: "Portfolio",
url: "https://portfolio.seancoughlin.me"
},
{
name: "Blog",
url: "https://blog.seancoughlin.me"
Expand Down
6 changes: 6 additions & 0 deletions tests/homepage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ test.describe("home page", () => {
await expect(
page.getByRole("banner").getByRole("link", { name: "GitHub" })
).toBeVisible();
await expect(
page.getByRole("banner").getByRole("link", { name: "Portfolio" })
).toBeVisible();
await expect(
page.getByRole("banner").getByRole("link", { name: "Blog" })
).toBeVisible();
Expand Down Expand Up @@ -57,6 +60,9 @@ test.describe("home page", () => {
await expect(
page.getByRole("contentinfo").getByRole("link", { name: "GitHub" })
).toBeVisible();
await expect(
page.getByRole("contentinfo").getByRole("link", { name: "Portfolio" })
).toBeVisible();
await expect(
page.getByRole("contentinfo").getByRole("link", { name: "Blog" })
).toBeVisible();
Expand Down

0 comments on commit fe25967

Please sign in to comment.