Skip to content

Commit

Permalink
feat: toggle repository notification
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jun 15, 2024
1 parent 25f33b8 commit 6065340
Show file tree
Hide file tree
Showing 2 changed files with 377 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/Repository.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fireEvent, render, screen } from '@testing-library/react';
import { act, fireEvent, render, screen } from '@testing-library/react';
import { mockGitHubCloudAccount } from '../__mocks__/state-mocks';
import { AppContext } from '../context/App';
import type { Link } from '../types';
Expand Down Expand Up @@ -91,4 +91,15 @@ describe('components/Repository.tsx', () => {
);
expect(tree).toMatchSnapshot();
});

it('should toggle account notifications visibility', async () => {
await act(async () => {
render(<RepositoryNotifications {...props} />);
});

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

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

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

0 comments on commit 6065340

Please sign in to comment.