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
7 changes: 7 additions & 0 deletions src/components/notifications/NotificationBell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ describe("NotificationBell", () => {
fireEvent.click(button);

expect(screen.getByText("Loading...")).toBeInTheDocument();

// Let the mocked 100ms request settle before the test ends — a timer that
// outlives the test fires after vitest tears down jsdom, and the resulting
// state update throws "window is not defined" from an unrelated file.
await waitFor(() =>
expect(screen.queryByText("Loading...")).not.toBeInTheDocument()
);
});

it("marks notification as read when clicked", async () => {
Expand Down
9 changes: 9 additions & 0 deletions src/components/reviews/ReviewForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@ describe("ReviewForm", () => {
fireEvent.click(submitButton);

expect(screen.getByText("Submitting...")).toBeInTheDocument();

// Let the mocked 100ms request settle before the test ends. Otherwise the
// timer outlives the test, vitest tears down jsdom, and the component's
// late setIsSubmitting(false) hits React with no `window` — surfacing as
// "ReferenceError: window is not defined" in an unrelated file. It only
// reproduces under CI timing, so it reads as a random CI failure.
await waitFor(() =>
expect(screen.queryByText("Submitting...")).not.toBeInTheDocument()
);
});

it("trims comment before sending", async () => {
Expand Down
Loading