We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 180179e commit b08dbfeCopy full SHA for b08dbfe
src/__tests__/act.js
@@ -14,6 +14,14 @@ test('render calls useEffect immediately', () => {
14
expect(effectCb).toHaveBeenCalledTimes(1)
15
})
16
17
+test('findByTestId returns the element', async () => {
18
+ const ref = React.createRef()
19
+ const {findByTestId, getByTestId} = render(
20
+ <div ref={ref} data-testid="foo" />,
21
+ )
22
+ await expect(findByTestId('foo')).resolves.toEqual(getByTestId('foo'))
23
+})
24
+
25
test('fireEvent triggers useEffect calls', () => {
26
const effectCb = jest.fn()
27
function Counter() {
0 commit comments