Skip to content

Commit

Permalink
fix: delay state
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jun 16, 2024
1 parent 2163a49 commit 4c2707d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/components/NotificationRow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,35 @@ describe('components/NotificationRow.tsx', () => {
expect(removeNotificationFromState).toHaveBeenCalledTimes(1);
});

it('should open a notification in the browser - delay notification setting enabled', () => {
const removeNotificationFromState = jest.fn();

const props = {
notification: mockSingleNotification,
account: mockGitHubCloudAccount,
};

render(
<AppContext.Provider
value={{
settings: {
...mockSettings,
markAsDoneOnOpen: false,
delayNotificationState: true,
},
removeNotificationFromState,
auth: mockAuth,
}}
>
<NotificationRow {...props} />
</AppContext.Provider>,
);

fireEvent.click(screen.getByRole('main'));
expect(links.openNotification).toHaveBeenCalledTimes(1);
expect(removeNotificationFromState).toHaveBeenCalledTimes(1);
});

it('should open a notification in the browser - key down', () => {
const removeNotificationFromState = jest.fn();

Expand Down

0 comments on commit 4c2707d

Please sign in to comment.