8000 chore: add notification UI components by BrunoQuaresma · Pull Request #16818 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: add notification UI components #16818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 12, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix test
  • Loading branch information
BrunoQuaresma committed Mar 11, 2025
commit 12fe3d85867d4fd56b85e4ad4bfc41c788062064
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react";
import { expect, fn, userEvent, within } from "@storybook/test";
import { expect, fn, userEvent, waitFor, within } from "@storybook/test";
import { MockNotifications, mockApiError } from "testHelpers/entities";
import { withGlobalSnackbar } from "testHelpers/storybook";
import { NotificationsInbox } from "./NotificationsInbox";
Expand Down Expand Up @@ -51,9 +51,7 @@ export const FailAndRetry: Story = {
return fn(async () => {
count += 1;

// Fail on the first 3 attempts
// 3 is the maximum number of retries from react-query
if (count < 3) {
if (count === 1) {
throw mockApiError({
message: "Failed to load notifications",
});
Expand All @@ -74,9 +72,11 @@ export const FailAndRetry: Story = {

const retryButton = body.getByRole("button", { name: /retry/i });
await userEvent.click(retryButton);
await expect(
body.queryByText("Error loading notifications"),
).not.toBeInTheDocument();
await waitFor(() => {
expect(
body.queryByText("Error loading notifications"),
).not.toBeInTheDocument();
});
},
};

Expand Down
Loading
0