Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/components/GameListItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ describe("GameListItem", () => {
expect(screen.getByRole("img", { name: "Great Game" })).toHaveAttribute("src", "/game.png");
});

it("falls back to an em dash when year or tags are missing", () => {
it("falls back to N/A when year or tags are missing", () => {
renderItem({ year: null, tags: "" });
expect(screen.getAllByText("—")).toHaveLength(2);
expect(screen.getAllByText("N/A")).toHaveLength(2);
});

it("links to the game's detail page", () => {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("Header", () => {

it("renders the wordmark, search field and My Ratings link", () => {
renderHeader("/project2");
expect(screen.getByText("Working Title")).toBeInTheDocument();
expect(screen.getByText("NTNU GameShelf")).toBeInTheDocument();
expect(screen.getByPlaceholderText("Search games...")).toHaveValue("");
expect(screen.getByText("My Ratings")).toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Clear" })).not.toBeInTheDocument();
Expand Down Expand Up @@ -58,7 +58,7 @@ describe("Header", () => {

it("links home to the current query on the grid page", () => {
renderHeader("/project2?search=zelda");
expect(screen.getByText("Working Title").closest("a")).toHaveAttribute(
expect(screen.getByText("NTNU GameShelf").closest("a")).toHaveAttribute(
"href",
"/project2/?search=zelda",
);
Expand All @@ -67,14 +67,14 @@ describe("Header", () => {
it("links home to the persisted grid query from other pages", () => {
sessionStorage.setItem(GRID_QUERY_STORAGE_KEY, "search=bar");
renderHeader("/project2/my-ratings");
expect(screen.getByText("Working Title").closest("a")).toHaveAttribute(
expect(screen.getByText("NTNU GameShelf").closest("a")).toHaveAttribute(
"href",
"/project2/?search=bar",
);
});

it("links home plainly when there is no persisted query", () => {
renderHeader("/project2/my-ratings");
expect(screen.getByText("Working Title").closest("a")).toHaveAttribute("href", "/project2");
expect(screen.getByText("NTNU GameShelf").closest("a")).toHaveAttribute("href", "/project2");
});
});