diff --git a/package.json b/package.json
index ffb0ee9..0d64adf 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,8 @@
"start": "next start",
"lint": "next lint",
"test": "jest",
- "test:watch": "jest --watch"
+ "test:watch": "jest --watch",
+ "test:coverage": "jest --coverage"
},
"dependencies": {
"@nextui-org/react": "^2.4.2",
diff --git a/src/__tests__/page.test.tsx b/src/__tests__/page.test.tsx
index 8f8a0f7..cb4ac54 100644
--- a/src/__tests__/page.test.tsx
+++ b/src/__tests__/page.test.tsx
@@ -2,12 +2,28 @@ import "@testing-library/jest-dom";
import { render, screen } from "@testing-library/react";
import Page from "../app/page";
-describe("Page", () => {
- it("renders a heading", () => {
+describe("Main Page", () => {
+ it("Renders the proper title and content text", () => {
render();
+ const timeRegEx = /([0-9]+(:[0-9]+)+)\s[AP]M/i;
+
+ const logo = screen.getByTestId("logo");
const heading = screen.getByRole("heading", { level: 1 });
+ const subheader = screen.getByTestId("subheader");
+ const location = screen.getByTestId("location");
+ const time = screen.getByTestId("time");
+ const content = screen.getByTestId("content");
- expect(heading).toBeInTheDocument();
+ expect(logo.innerHTML).toEqual("KGM");
+ expect(heading.innerHTML).toEqual("Kaj Grant-Mathiasen");
+ expect(subheader.innerHTML).toEqual(
+ "Computer Engineer / Cloud Engineer / Full-Stack Developer"
+ );
+ expect(location.innerHTML).toContain("Vancouver, BC. Canada");
+ expect(time.innerHTML).toMatch(timeRegEx);
+ expect(content.innerHTML).toEqual(
+ "Currently an Associate Cloud Support Engineer @ Canonical"
+ );
});
});
diff --git a/src/components/content.tsx b/src/components/content.tsx
index 259b506..03a3cf9 100644
--- a/src/components/content.tsx
+++ b/src/components/content.tsx
@@ -30,7 +30,10 @@ export function Content() {
-
+
Currently an Associate Cloud Support Engineer @ Canonical
diff --git a/src/components/header.tsx b/src/components/header.tsx
index ece1d04..79e849b 100644
--- a/src/components/header.tsx
+++ b/src/components/header.tsx
@@ -3,14 +3,12 @@ import { Location } from "./location";
import { Time } from "./time";
import { brushData } from "@/data/svg/brush";
-export function Header(props: { text?: string; subheader?: string }) {
- const text = props.text ? props.text : "Kaj Grant-Mathiasen";
-
+export function Header() {
return (
- {text}
+ Kaj Grant-Mathiasen