Skip to content

Commit 17b76d0

Browse files
committed
e.. t la pièce jointe !
1 parent e3519e1 commit 17b76d0

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

src/pages/home-page.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import CounterCard from '@/components/counter-card.component.vue'
2+
import CounterCard from '@/components/counter-card.vue'
33
</script>
44

55
<template>

src/router/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createRouter, createWebHistory } from 'vue-router'
2-
import HomePage from '~/pages/HomePage.vue'
2+
import HomePage from '@/pages/home-page.vue'
33

44
const router = createRouter({
55
history: createWebHistory(import.meta.env.BASE_URL),

tests/components/counter-card.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { describe, it, expect } from 'vitest'
22

33
import { shallowMount } from '@vue/test-utils'
4-
import CounterCard from '../../src/components/counter-card.component.vue'
4+
import CounterCard from '../../src/components/counter-card.vue'
55
import { createPinia, setActivePinia } from 'pinia'
66

7-
describe('CounterCard', () => {
8-
it('renders properly', () => {
7+
describe('Counter card', () => {
8+
it('should render properly', () => {
99
setActivePinia(createPinia())
1010
const wrapper = shallowMount(CounterCard, { props: { msg: 'Hello VueJS' } })
1111

tests/pages/home.page.spec.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { describe, it, expect } from 'vitest'
2+
3+
import { shallowMount } from '@vue/test-utils'
4+
import { createPinia, setActivePinia } from 'pinia'
5+
import HomePage from '../../src/pages/home-page.vue'
6+
import CounterCard from '../../src/components/counter-card.vue'
7+
8+
describe('Home page', () => {
9+
it('should display a counter card', () => {
10+
setActivePinia(createPinia())
11+
const wrapper = shallowMount(HomePage)
12+
const counterCard = wrapper.findComponent(CounterCard)
13+
14+
expect(counterCard.exists()).toBe(true)
15+
})
16+
})

0 commit comments

Comments
 (0)