@@ -23,7 +23,7 @@ describe('#createWeb3ReactStoreAndActions', () => {
23
23
} )
24
24
25
25
describe ( '#startActivation' , ( ) => {
26
- test ( '# works' , ( ) => {
26
+ test ( 'works' , ( ) => {
27
27
const [ store , actions ] = createWeb3ReactStoreAndActions ( )
28
28
actions . startActivation ( )
29
29
expect ( store . getState ( ) ) . toEqual ( {
@@ -33,6 +33,7 @@ describe('#createWeb3ReactStoreAndActions', () => {
33
33
error : undefined ,
34
34
} )
35
35
} )
36
+
36
37
test ( 'cancellation works' , ( ) => {
37
38
const [ store , actions ] = createWeb3ReactStoreAndActions ( )
38
39
const cancelActivation = actions . startActivation ( )
@@ -185,15 +186,29 @@ describe('#createWeb3ReactStoreAndActions', () => {
185
186
} )
186
187
} )
187
188
188
- test ( '#reportError' , ( ) => {
189
- const [ store , actions ] = createWeb3ReactStoreAndActions ( )
190
- const error = new Error ( )
191
- actions . reportError ( error )
192
- expect ( store . getState ( ) ) . toEqual ( {
193
- chainId : undefined ,
194
- accounts : undefined ,
195
- activating : false ,
196
- error,
189
+ describe ( '#reportError' , ( ) => {
190
+ test ( 'sets error' , ( ) => {
191
+ const [ store , actions ] = createWeb3ReactStoreAndActions ( )
192
+ const error = new Error ( )
193
+ actions . reportError ( error )
194
+ expect ( store . getState ( ) ) . toEqual ( {
195
+ chainId : undefined ,
196
+ accounts : undefined ,
197
+ activating : false ,
198
+ error,
199
+ } )
200
+ } )
201
+
202
+ test ( 'resets state' , ( ) => {
203
+ const [ store , actions ] = createWeb3ReactStoreAndActions ( )
204
+ actions . reportError ( new Error ( ) )
205
+ actions . reportError ( undefined )
206
+ expect ( store . getState ( ) ) . toEqual ( {
207
+ chainId : undefined ,
208
+ accounts : undefined ,
209
+ activating : false ,
210
+ error : undefined ,
211
+ } )
197
212
} )
198
213
} )
199
214
} )
0 commit comments