Skip to content

Commit 2a636ee

Browse files
committed
Tests if AttributionDetailsStep component is mounted correctly
1 parent ff6d11b commit 2a636ee

File tree

2 files changed

+311
-0
lines changed

2 files changed

+311
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { createLocalVue, mount } from '@vue/test-utils'
2+
import Buefy from 'buefy'
3+
import Vuex from 'vuex'
4+
import AttributionDetailsStep from '@/components/AttributionDetailsStep'
5+
6+
const localVue = createLocalVue()
7+
8+
localVue.use(Vuex)
9+
localVue.use(Buefy)
10+
11+
it('AttributionDetailsStep Component is mounted if status is current', () => {
12+
const wrapper = mount(AttributionDetailsStep, {
13+
localVue,
14+
propsData: {
15+
status: 'current'
16+
17+
},
18+
mocks: {
19+
$t: key => key,
20+
$store: {
21+
state: {
22+
attributionDetails: {
23+
creatorName: '',
24+
creatorProfileUrl: '',
25+
workTitle: '',
26+
workUrl: ''
27+
}
28+
}
29+
}
30+
}
31+
32+
})
33+
expect(wrapper.element).toMatchSnapshot()
34+
})
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`AttributeDetailsStep Component is mounted if status is current 1`] = `
4+
<div
5+
class="step-content"
6+
>
7+
<div
8+
class="step-actions"
9+
>
10+
<p
11+
class="attribution-details-instructions"
12+
>
13+
14+
stepper.AD.instructions
15+
16+
</p>
17+
18+
<form
19+
class="attribution-details-form"
20+
>
21+
<div
22+
class="field"
23+
>
24+
<label
25+
class="label"
26+
>
27+
stepper.AD.form.creator-name.label
28+
</label>
29+
30+
<div
31+
class="control is-clearfix"
32+
>
33+
<input
34+
autocomplete="on"
35+
class="input"
36+
placeholder="stepper.AD.form.creator-name.placeholder"
37+
type="text"
38+
/>
39+
40+
<!---->
41+
42+
<!---->
43+
44+
<!---->
45+
</div>
46+
47+
<!---->
48+
</div>
49+
50+
<div
51+
class="field"
52+
>
53+
<label
54+
class="label"
55+
>
56+
stepper.AD.form.creator-profile.label
57+
</label>
58+
59+
<div
60+
class="control is-clearfix"
61+
>
62+
<input
63+
autocomplete="on"
64+
class="input"
65+
placeholder="stepper.AD.form.creator-profile.placeholder"
66+
type="text"
67+
/>
68+
69+
<!---->
70+
71+
<!---->
72+
73+
<!---->
74+
</div>
75+
76+
<!---->
77+
</div>
78+
79+
<div
80+
class="field"
81+
>
82+
<label
83+
class="label"
84+
>
85+
stepper.AD.form.work-title.label
86+
</label>
87+
88+
<div
89+
class="control is-clearfix"
90+
>
91+
<input
92+
autocomplete="on"
93+
class="input"
94+
placeholder="stepper.AD.form.work-title.placeholder"
95+
type="text"
96+
/>
97+
98+
<!---->
99+
100+
<!---->
101+
102+
<!---->
103+
</div>
104+
105+
<!---->
106+
</div>
107+
108+
<div
109+
class="field"
110+
>
111+
<label
112+
class="label"
113+
>
114+
stepper.AD.form.work-url.label
115+
</label>
116+
117+
<div
118+
class="control is-clearfix"
119+
>
120+
<input
121+
autocomplete="on"
122+
class="input"
123+
placeholder="stepper.AD.form.work-url.placeholder"
124+
type="text"
125+
/>
126+
127+
<!---->
128+
129+
<!---->
130+
131+
<!---->
132+
</div>
133+
134+
<!---->
135+
</div>
136+
</form>
137+
</div>
138+
</div>
139+
`;
140+
141+
exports[`AttributionDetailsStep Component is mounted if status is current 1`] = `
142+
<div
143+
class="step-content"
144+
>
145+
<div
146+
class="step-actions"
147+
>
148+
<p
149+
class="attribution-details-instructions"
150+
>
151+
152+
stepper.AD.instructions
153+
154+
</p>
155+
156+
<form
157+
class="attribution-details-form"
158+
>
159+
<div
160+
class="field"
161+
>
162+
<label
163+
class="label"
164+
>
165+
stepper.AD.form.creator-name.label
166+
</label>
167+
168+
<div
169+
class="control is-clearfix"
170+
>
171+
<input
172+
autocomplete="on"
173+
class="input"
174+
placeholder="stepper.AD.form.creator-name.placeholder"
175+
type="text"
176+
/>
177+
178+
<!---->
179+
180+
<!---->
181+
182+
<!---->
183+
</div>
184+
185+
<!---->
186+
</div>
187+
188+
<div
189+
class="field"
190+
>
191+
<label
192+
class="label"
193+
>
194+
stepper.AD.form.creator-profile.label
195+
</label>
196+
197+
<div
198+
class="control is-clearfix"
199+
>
200+
<input
201+
autocomplete="on"
202+
class="input"
203+
placeholder="stepper.AD.form.creator-profile.placeholder"
204+
type="text"
205+
/>
206+
207+
<!---->
208+
209+
<!---->
210+
211+
<!---->
212+
</div>
213+
214+
<!---->
215+
</div>
216+
217+
<div
218+
class="field"
219+
>
220+
<label
221+
class="label"
222+
>
223+
stepper.AD.form.work-title.label
224+
</label>
225+
226+
<div
227+
class="control is-clearfix"
228+
>
229+
<input
230+
autocomplete="on"
231+
class="input"
232+
placeholder="stepper.AD.form.work-title.placeholder"
233+
type="text"
234+
/>
235+
236+
<!---->
237+
238+
<!---->
239+
240+
<!---->
241+
</div>
242+
243+
<!---->
244+
</div>
245+
246+
<div
247+
class="field"
248+
>
249+
<label
250+
class="label"
251+
>
252+
stepper.AD.form.work-url.label
253+
</label>
254+
255+
<div
256+
class="control is-clearfix"
257+
>
258+
<input
259+
autocomplete="on"
260+
class="input"
261+
placeholder="stepper.AD.form.work-url.placeholder"
262+
type="text"
263+
/>
264+
265+
<!---->
266+
267+
<!---->
268+
269+
<!---->
270+
</div>
271+
272+
<!---->
273+
</div>
274+
</form>
275+
</div>
276+
</div>
277+
`;

0 commit comments

Comments
 (0)