Skip to content

Commit 4b723df

Browse files
adds tests
1 parent a13f4fc commit 4b723df

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

src/views/TutorPage.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ const stepToAction = {
2727
</script>
2828
<template>
2929
<div class="content-centered-wrapper">
30-
<StepsIndicator :step="step" :setStep="setStep" stepsLength="3" />
30+
<StepsIndicator :step="step" :setStep="setStep" :stepsLength="3" />
3131
<div class="layout-flex">
3232
<div class="flex-wrap" :class="{ shrink: step === 3 }">
33-
<FirstStep :disabled="step > 1" v-if="step >= 1" />
34-
<SecondStep :disabled="step > 2" :visible="step >= 2" />
33+
<FirstStep data-test="fist-step" :disabled="step > 1" v-if="step >= 1" />
34+
<SecondStep data-test="second-step" :disabled="step > 2" :visible="step >= 2" />
3535
</div>
36-
<ThirdStep :visible="step >= 3" />
36+
<ThirdStep data-test="third-step" :visible="step >= 3" />
3737
</div>
3838
<div class="actions">
3939
<button class="button" v-if="step > 1" @click="step = step - 1">previous</button>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { describe, it, expect } from 'vitest';
2+
import { shallowMount } from '@vue/test-utils';
3+
import TutorPage from '../TutorPage.vue';
4+
5+
describe('TutorPage', () => {
6+
it('renders properly', () => {
7+
const wrapper = shallowMount(TutorPage);
8+
expect(wrapper.element).toMatchSnapshot();
9+
});
10+
});
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`TutorPage > renders properly 1`] = `
4+
<div
5+
class="content-centered-wrapper"
6+
data-v-8a8621cb=""
7+
>
8+
<steps-indicator-stub
9+
data-v-8a8621cb=""
10+
setstep="[Function]"
11+
step="1"
12+
stepslength="3"
13+
/>
14+
<div
15+
class="layout-flex"
16+
data-v-8a8621cb=""
17+
>
18+
<div
19+
class="flex-wrap"
20+
data-v-8a8621cb=""
21+
>
22+
<first-step-stub
23+
data-test="fist-step"
24+
data-v-8a8621cb=""
25+
disabled="false"
26+
/>
27+
<second-step-stub
28+
data-test="second-step"
29+
data-v-8a8621cb=""
30+
disabled="false"
31+
visible="false"
32+
/>
33+
</div>
34+
<third-step-stub
35+
data-test="third-step"
36+
data-v-8a8621cb=""
37+
visible="false"
38+
/>
39+
</div>
40+
<div
41+
class="actions"
42+
data-v-8a8621cb=""
43+
>
44+
<!--v-if-->
45+
<button
46+
class="button"
47+
data-v-8a8621cb=""
48+
>
49+
next
50+
</button>
51+
</div>
52+
</div>
53+
`;

0 commit comments

Comments
 (0)