File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -133,20 +133,25 @@ describe(
133
133
} )
134
134
135
135
it ( 'skips resetting by default' , async ( ) => {
136
- const { wrapper, itemRef, data } = factory ( )
137
-
136
+ const itemRef = doc ( )
138
137
await setDoc ( itemRef , { name : 'a' } )
138
+ const { wrapper, data, promise } = factory ( { ref : itemRef } )
139
+ await promise . value
140
+
139
141
expect ( data . value ) . toEqual ( { name : 'a' } )
140
142
await wrapper . unmount ( )
141
143
expect ( data . value ) . toEqual ( { name : 'a' } )
142
144
} )
143
145
144
146
it ( 'can be reset to a specific value' , async ( ) => {
145
- const { wrapper, itemRef, data } = factory ( {
147
+ const itemRef = doc ( )
148
+ await setDoc ( itemRef , { name : 'a' } )
149
+ const { wrapper, data, promise } = factory ( {
150
+ ref : itemRef ,
146
151
options : { reset : ( ) => 'reset' } ,
147
152
} )
153
+ await promise . value
148
154
149
- await setDoc ( itemRef , { name : 'a' } )
150
155
expect ( data . value ) . toEqual ( { name : 'a' } )
151
156
await wrapper . unmount ( )
152
157
expect ( data . value ) . toEqual ( 'reset' )
You can’t perform that action at this time.
0 commit comments