Last active
January 1, 2022 08:31
-
-
Save ifndefdeadmau5/addef61a6de25d08599676661a6a3be5 to your computer and use it in GitHub Desktop.
flaky-test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '@testing-library/jest-dom/extend-expect' | |
import * as React from 'react' | |
import {render, screen} from '@testing-library/react' | |
import userEvent from '@testing-library/user-event' | |
import SimpleList from '../SimpleList' | |
test('can remove items from the list', () => { | |
render(<SimpleList />) | |
const deleteButton = fireEvent.click(screen.queryAllByTestId('delete-button')[0] as HTMLElement) | |
userEvent.click(deleteButton) | |
expect(deleteButton).not.toBeInTheDocument() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment