@@ -4,7 +4,7 @@ import Vuex from 'vuex'
44import AttributionDetailsStep from '@/components/AttributionDetailsStep'
55
66const localVue = createLocalVue ( )
7-
7+
88localVue . use ( Vuex )
99localVue . use ( Buefy )
1010
@@ -27,40 +27,40 @@ describe('AttributionDetailsStep Component Rendering', () => {
2727 }
2828 }
2929 }
30-
30+
3131 } )
3232 } )
3333
34- afterEach ( ( ) => {
34+ afterEach ( ( ) => {
3535 wrapper . destroy ( )
3636 } )
3737
38- it ( 'Component not mounted if status is previous' , ( ) => {
39- wrapper . setProps ( { status : 'previous' } )
38+ it ( 'Component not mounted if status is previous' , ( ) => {
39+ wrapper . setProps ( { status : 'previous' } )
4040 expect ( wrapper . find ( '.step-actions' ) . exists ( ) ) . toBeFalsy ( )
4141 } )
4242
43- it ( 'Component not mounted if status is inactive' , ( ) => {
44- wrapper . setProps ( { status : 'inactive' } )
43+ it ( 'Component not mounted if status is inactive' , ( ) => {
44+ wrapper . setProps ( { status : 'inactive' } )
4545 expect ( wrapper . find ( '.step-actions' ) . exists ( ) ) . toBeFalsy ( )
4646 } )
4747
48- it ( 'Component mounted if status is current' , ( ) => {
49- wrapper . setProps ( { status : 'current' } )
48+ it ( 'Component mounted if status is current' , ( ) => {
49+ wrapper . setProps ( { status : 'current' } )
5050 expect ( wrapper . element ) . toMatchSnapshot ( )
5151 } )
5252} )
5353
5454describe ( 'Store is updated when a user provides input' , ( ) => {
55- let mutations , state , wrapper , store
55+ let mutations , state , wrapper , store
5656
5757 beforeEach ( ( ) => {
5858 mutations = {
5959 setCreatorName : jest . fn ( ) ,
6060 setCreatorProfileUrl : jest . fn ( ) ,
6161 setWorkTitle : jest . fn ( ) ,
6262 setWorkUrl : jest . fn ( )
63- } ;
63+ }
6464
6565 state = {
6666 attributionDetails : {
@@ -69,54 +69,53 @@ describe('Store is updated when a user provides input', () => {
6969 workTitle : '' ,
7070 workUrl : ''
7171 }
72- } ;
72+ }
7373
7474 store = new Vuex . Store ( {
7575 state,
76- mutations,
77- } ) ;
76+ mutations
77+ } )
7878
7979 wrapper = mount ( AttributionDetailsStep , {
8080 propsData : {
8181 status : 'current'
8282 } ,
8383 mocks : {
8484 $t : key => key
85- } ,
85+ } ,
8686 store,
87- localVue,
88- } ) ;
87+ localVue
88+ } )
8989 } )
9090
91- afterEach ( ( ) => {
91+ afterEach ( ( ) => {
9292 wrapper . destroy ( )
9393 } )
9494
9595 it ( 'Creator Name is updated' , async ( ) => {
96- const input = wrapper . find ( 'input[placeholder="stepper.AD.form.creator-name.placeholder"]' )
97- await input . setValue ( " Jane Bar" )
98- expect ( mutations . setCreatorName ) . toHaveBeenCalled ( )
99- } )
100-
101- //CreatorProfile URL
96+ const input = wrapper . find ( 'input[placeholder="stepper.AD.form.creator-name.placeholder"]' )
97+ await input . setValue ( ' Jane Bar' )
98+ expect ( mutations . setCreatorName ) . toHaveBeenCalled ( )
99+ } )
100+
101+ // CreatorProfile URL
102102 it ( 'Profile Url is updated' , async ( ) => {
103- const input = wrapper . find ( 'input[placeholder="stepper.AD.form.creator-profile.placeholder"]' )
104- await input . setValue ( " jane@bar.com" )
105- expect ( mutations . setCreatorProfileUrl ) . toHaveBeenCalled ( )
106- } )
103+ const input = wrapper . find ( 'input[placeholder="stepper.AD.form.creator-profile.placeholder"]' )
104+ await input . setValue ( ' jane@bar.com' )
105+ expect ( mutations . setCreatorProfileUrl ) . toHaveBeenCalled ( )
106+ } )
107107
108- //Work URL
108+ // Work URL
109109 it ( 'Work Url is updated' , async ( ) => {
110- const input = wrapper . find ( 'input[placeholder="stepper.AD.form.work-url.placeholder"]' )
111- await input . setValue ( " jane@bar.com/kitty.jpeg" )
112- expect ( mutations . setWorkUrl ) . toHaveBeenCalled ( )
113- } )
110+ const input = wrapper . find ( 'input[placeholder="stepper.AD.form.work-url.placeholder"]' )
111+ await input . setValue ( ' jane@bar.com/kitty.jpeg' )
112+ expect ( mutations . setWorkUrl ) . toHaveBeenCalled ( )
113+ } )
114114
115- //Work Title
115+ // Work Title
116116 it ( 'Work Title is updated' , async ( ) => {
117- const input = wrapper . find ( 'input[placeholder="stepper.AD.form.work-title.placeholder"]' )
118- await input . setValue ( "illustrator" )
119- expect ( mutations . setWorkTitle ) . toHaveBeenCalled ( )
120- } )
121-
122- } )
117+ const input = wrapper . find ( 'input[placeholder="stepper.AD.form.work-title.placeholder"]' )
118+ await input . setValue ( 'illustrator' )
119+ expect ( mutations . setWorkTitle ) . toHaveBeenCalled ( )
120+ } )
121+ } )
0 commit comments