-
Notifications
You must be signed in to change notification settings - Fork 37
fix(#2881): temporary notification set 0 to stop auto-dismiss #2882
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -217,24 +217,24 @@ describe("Temporary Notification Controller", () => { | |
| }; | ||
|
|
||
| const result = render(<Component />); | ||
| const notification = result.getByTestId("cancel-notification"); | ||
| const actionButton = result.getByRole("button"); | ||
|
|
||
|
|
||
| await vi.waitFor(async () => { | ||
| sendCancellableNotificationWithoutNotificationResponse("Notification with cancel action", "cancel-notification"); | ||
|
|
||
| // Verify the notification is displayed | ||
| const notification = result.getByTestId("cancel-notification"); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test failed in headless mode (passed in browser mode) because of a race condition. We query the notification outside the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I always run in headless mode and it never failed. I am also not clear on what you mean by us querying it before triggering it. |
||
| expect(notification.elements().length).toBe(1); | ||
| }, { timeout: 5000 }); | ||
|
|
||
| // Click the cancel button | ||
| expect(actionButton.elements().length).toBe(1); | ||
| await actionButton.click(); | ||
| // Get the action button and click it | ||
| const actionButton = result.getByRole("button"); | ||
| expect(actionButton.elements().length).toBe(1); | ||
| await actionButton.click(); | ||
|
|
||
| // Verify the notification is removed | ||
| await vi.waitFor(() => { | ||
| expect(notification.elements().length).toBe(0); | ||
| }); | ||
| }); | ||
| // Verify the notification is removed | ||
| await vi.waitFor(() => { | ||
| const notification = result.getByTestId("cancel-notification"); | ||
| expect(notification.elements().length).toBe(0); | ||
| }, { timeout: 5000 }); | ||
| }) | ||
|
|
||
| it.skip("should handle progress updates", async function () { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works as well, but what is the reason for the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we pass
0as a number, the!opts.durationis true, and it doesn't work.