1
1
import { StrictMode } from 'react'
2
- import { render , screen , waitFor } from '@testing-library/react'
2
+ import { render , screen } from '@testing-library/react'
3
3
import { expect , it } from 'vitest'
4
4
import { Provider , useAtom } from 'jotai/react'
5
5
import { atom , createStore } from 'jotai/vanilla'
6
6
7
- it ( 'uses initial values from provider' , async ( ) => {
7
+ it ( 'uses initial values from provider' , ( ) => {
8
8
const countAtom = atom ( 1 )
9
9
const petAtom = atom ( 'cat' )
10
10
@@ -32,13 +32,11 @@ it('uses initial values from provider', async () => {
32
32
</ StrictMode > ,
33
33
)
34
34
35
- await waitFor ( ( ) => {
36
- expect ( screen . getByText ( 'count: 0' ) ) . toBeInTheDocument ( )
37
- expect ( screen . getByText ( 'pet: dog' ) ) . toBeInTheDocument ( )
38
- } )
35
+ expect ( screen . getByText ( 'count: 0' ) ) . toBeInTheDocument ( )
36
+ expect ( screen . getByText ( 'pet: dog' ) ) . toBeInTheDocument ( )
39
37
} )
40
38
41
- it ( 'only uses initial value from provider for specific atom' , async ( ) => {
39
+ it ( 'only uses initial value from provider for specific atom' , ( ) => {
42
40
const countAtom = atom ( 1 )
43
41
const petAtom = atom ( 'cat' )
44
42
@@ -65,10 +63,8 @@ it('only uses initial value from provider for specific atom', async () => {
65
63
</ StrictMode > ,
66
64
)
67
65
68
- await waitFor ( ( ) => {
69
- expect ( screen . getByText ( 'count: 1' ) ) . toBeInTheDocument ( )
70
- expect ( screen . getByText ( 'pet: dog' ) ) . toBeInTheDocument ( )
71
- } )
66
+ expect ( screen . getByText ( 'count: 1' ) ) . toBeInTheDocument ( )
67
+ expect ( screen . getByText ( 'pet: dog' ) ) . toBeInTheDocument ( )
72
68
} )
73
69
74
70
it ( 'renders correctly without children' , ( ) => {
0 commit comments