Skip to content
Closed
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
34 changes: 2 additions & 32 deletions desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion desktop/src/apps/CrosswordsApp.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("CrosswordsApp", () => {
expect(within(firstCell).queryByText("S")).toBeNull();
});

it("navigates to a clue's starting cell and direction when the clue is clicked", async () => {
it("navigates to a clue\'s starting cell and direction when the clue is clicked", async () => {
render(<CrosswordsApp windowId="win-cw-4" />);
await flush();

Expand All @@ -82,4 +82,26 @@ describe("CrosswordsApp", () => {
const activeClueItem = screen.getByRole("button", { name: /1 across: celestial objects/i });
expect(activeClueItem).toHaveStyle({ background: "rgba(251, 191, 36, 0.25)" });
});

it("clicks check answers button to enter check mode", async () => {
render(<CrosswordsApp windowId="win-cw-5" />);
await flush();

const checkButton = screen.getByRole("button", { name: /check answers/i });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 The Roast: Using fireEvent.click instead of userEvent.click from @testing-library/user-event. fireEvent doesn't simulate real browser events (no focus, no selection changes, no proper event propagation). It's the fast-food version of user interaction — looks like a click, digests like regret.

🩹 The Fix:

Suggested change
const checkButton = screen.getByRole("button", { name: /check answers/i });
import userEvent from "@testing-library/user-event";

📏 Severity: suggestion


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

fireEvent.click(checkButton);
await flush();

expect(checkButton).toBeInTheDocument();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 The Roast: This test clicks the "Check Answers" button and then... asserts the button still exists. That's like checking if a light switch is still on the wall after you flip it. It verifies exactly zero behavior — no check mode entered, no answers validated, no UI state change confirmed. It's a participation trophy of a test.

🩹 The Fix:

Suggested change
expect(checkButton).toBeInTheDocument();
expect(screen.getByText(/check mode/i)).toBeInTheDocument();

📏 Severity: warning


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

});

it("switches to next puzzle", async () => {
render(<CrosswordsApp windowId="win-cw-6" />);
await flush();

const newPuzzleButton = screen.getByRole("button", { name: /new puzzle/i });
fireEvent.click(newPuzzleButton);
await flush();

expect(screen.getByText(/crossword #2/i)).toBeTruthy();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 The Roast: The test clicks "New Puzzle" and checks for "Crossword #2" text. Better than the previous one, but still fragile — it only verifies text content, not that the grid actually reset, clues changed, or the previous puzzle state was cleaned up. What if the text is hardcoded and the grid still shows puzzle #1?

🩹 The Fix:

Suggested change
expect(screen.getByText(/crossword #2/i)).toBeTruthy();
expect(screen.getByText(/crossword #2/i)).toBeInTheDocument();
expect(screen.getByRole("grid", { name: /crossword grid/i })).toBeInTheDocument();

📏 Severity: suggestion


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

});
});
Loading