Skip to content

Commit

Permalink
feat: account notifications toggle via chevron
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jun 10, 2024
1 parent 6ce4ca8 commit d29dfba
Show file tree
Hide file tree
Showing 2 changed files with 247 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/AccountNotifications.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,21 @@ describe('components/AccountNotifications.tsx', () => {
expect(openAccountProfileMock).toHaveBeenCalledTimes(1);
expect(openAccountProfileMock).toHaveBeenCalledWith(mockGitHubCloudAccount);
});

it('should toggle account notifications visibility', async () => {
const props = {
account: mockGitHubCloudAccount,
notifications: mockGitHubNotifications,
showAccountHostname: true,
};

await act(async () => {
render(<AccountNotifications {...props} />);
});

fireEvent.click(screen.getByTitle('Hide account notifications'));

const tree = render(<AccountNotifications {...props} />);
expect(tree).toMatchSnapshot();
});
});
230 changes: 230 additions & 0 deletions src/components/__snapshots__/AccountNotifications.test.tsx.snap

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

0 comments on commit d29dfba

Please sign in to comment.