@@ -14,75 +14,7 @@ describe('Migration 071: Set completedOnboarding based on the KeyringController
1414 jest . resetAllMocks ( ) ;
1515 } ) ;
1616
17- const invalidStates = [
18- {
19- state : null ,
20- scenario : 'state is invalid' ,
21- } ,
22- {
23- state : merge ( { } , initialRootState , {
24- engine : null ,
25- } ) ,
26- scenario : 'engine state is invalid' ,
27- } ,
28- {
29- state : merge ( { } , initialRootState , {
30- engine : {
31- backgroundState : null ,
32- } ,
33- } ) ,
34- scenario : 'backgroundState is invalid' ,
35- } ,
36- ] ;
37-
38- it . each ( invalidStates ) ( 'captures exception if %s' , async ( { state } ) => {
39- const newState = await migrate ( state ) ;
40-
41- expect ( newState ) . toStrictEqual ( state ) ;
42- expect ( mockedCaptureException ) . toHaveBeenCalledWith ( expect . any ( Error ) ) ;
43- } ) ;
44-
45- it ( 'sets completedOnboarding to true if vault exists' , ( ) => {
46- const state = merge ( { } , initialRootState , {
47- onboarding : {
48- completedOnboarding : false ,
49- } ,
50- engine : {
51- backgroundState : {
52- KeyringController : {
53- vault : true ,
54- } ,
55- } ,
56- } ,
57- } ) ;
58-
59- migrate ( state ) ;
60-
61- expect ( state . onboarding . completedOnboarding ) . toBe ( true ) ;
62- expect ( mockedCaptureException ) . not . toHaveBeenCalled ( ) ;
63- } ) ;
64-
65- it ( 'sets completedOnboarding to false if vault does not exist' , ( ) => {
66- const state = merge ( { } , initialRootState , {
67- onboarding : {
68- completedOnboarding : false ,
69- } ,
70- engine : {
71- backgroundState : {
72- KeyringController : {
73- vault : false ,
74- } ,
75- } ,
76- } ,
77- } ) ;
78-
79- migrate ( state ) ;
80-
81- expect ( state . onboarding . completedOnboarding ) . toBe ( false ) ;
82- expect ( mockedCaptureException ) . not . toHaveBeenCalled ( ) ;
83- } ) ;
84-
85- it ( 'adds the completedOnboarding property if it does not exist' , ( ) => {
17+ it ( 'returns the initial state' , ( ) => {
8618 const state = merge ( { } , initialRootState , {
8719 onboarding : { } ,
8820 engine : {
@@ -94,9 +26,9 @@ describe('Migration 071: Set completedOnboarding based on the KeyringController
9426 } ,
9527 } ) ;
9628
97- migrate ( state ) ;
29+ const migratedState = migrate ( state ) ;
9830
99- expect ( state . onboarding . completedOnboarding ) . toBe ( true ) ;
31+ expect ( migratedState ) . toStrictEqual ( state ) ;
10032 expect ( mockedCaptureException ) . not . toHaveBeenCalled ( ) ;
10133 } ) ;
10234} ) ;
0 commit comments