Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit 8b4df94

Browse files
committed
test: add SeriesList component test
1 parent f27803d commit 8b4df94

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { mount, RouterLinkStub } from '@vue/test-utils'
2+
import { describe, expect, test, vi } from 'vitest'
3+
4+
import SeriesList from '~~/components/content/SeriesList.vue'
5+
6+
vi.mocked(resolveComponent).mockReturnValue(RouterLinkStub as any)
7+
8+
describe('components/content/SeriesList.vue', () => {
9+
test('renders series link', () => {
10+
const wrapper = mount(SeriesList, {
11+
props: { series: ['1st-jp', 'gb', 'us'] }
12+
})
13+
expect(wrapper.element).toMatchSnapshot()
14+
})
15+
})
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Vitest Snapshot v1
2+
3+
exports[`components/content/SeriesList.vue > renders series link 1`] = `
4+
<ul>
5+
6+
<li>
7+
<a>
8+
Dance Dance Revolution (JP)
9+
</a>
10+
</li>
11+
<li>
12+
<a>
13+
Dance Dance Revolution GB
14+
</a>
15+
</li>
16+
<li>
17+
<a>
18+
Dance Dance Revolution (US)
19+
</a>
20+
</li>
21+
22+
</ul>
23+
`;

0 commit comments

Comments
 (0)