Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrdam committed Jun 26, 2024
1 parent 8314276 commit a53f98d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/__snapshots__/app.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports[`App > should render App 1`] = `
>
<button>
count is
0
</button>
<p>
Edit
Expand Down
4 changes: 2 additions & 2 deletions src/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { App } from './app';
describe('App', () => {
test('should render App', () => {
const { container } = render(<App />);
expect(container.textContent).contains('Vite + Preactcount is Edit');
expect(container.textContent).contains('Vite + Preact');
expect(container).toMatchSnapshot();
});

test('should increment after "count is" button is clicked', async () => {
render(<App />);

fireEvent.click(screen.getByText('count is'));
fireEvent.click(screen.getByText('count is 0'));
await waitFor(() => {
// .toBeInTheDocument() is an assertion that comes from jest-dom.
// Otherwise you could use .toBeDefined().
Expand Down

0 comments on commit a53f98d

Please sign in to comment.