File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,20 @@ describe('CreateAccount.vue - Business Logic', () => {
6666 RightIcon : true ,
6767 } ,
6868 } )
69+
70+ ; ( wrapper as typeof wrapper & { setData : ( values : Record < string , unknown > ) => Promise < void > } ) . setData = async ( values ) => {
71+ const vm = wrapper . vm as Record < string , any > & { $nextTick : ( ) => Promise < void > }
72+ for ( const [ key , value ] of Object . entries ( values ) ) {
73+ vm [ key ] = value
74+ if ( vm . v ?. [ key ] ?. $model !== undefined ) {
75+ vm . v [ key ] . $model = value
76+ }
77+ if ( vm . v$ ?. [ key ] ?. $model !== undefined ) {
78+ vm . v$ [ key ] . $model = value
79+ }
80+ }
81+ await vm . $nextTick ( )
82+ }
6983 } )
7084
7185 describe ( 'emailError computed property' , ( ) => {
@@ -83,9 +97,6 @@ describe('CreateAccount.vue - Business Logic', () => {
8397 it ( 'returns error when email does not match invitation' , async ( ) => {
8498 wrapper . setData ( { email : 'wrong@example.com' } )
8599 await wrapper . vm . $nextTick ( )
86- // Force vuelidate to not show format error
87- wrapper . vm . v$ . email . $model = 'wrong@example.com'
88- await wrapper . vm . $nextTick ( )
89100 expect ( wrapper . vm . emailError ) . toBe ( 'The email entered is not the same as the email in the invitation' )
90101 } )
91102
You can’t perform that action at this time.
0 commit comments