Skip to content

Commit 9453032

Browse files
committed
feat: add snapshot test for test-vue-2 and update hover style for last list item
1 parent caa9d4e commit 9453032

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

test/__snapshots__/test-vue.test.ts.snap

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,34 @@ const newsList = [
4242
<style scoped></style>
4343
"
4444
`;
45+
46+
exports[`test-vue-2 > test-vue-2.vue 1`] = `
47+
"<script setup lang="ts">
48+
// 这里可以添加你的逻辑
49+
</script>
50+
<template>
51+
<p class="font-bold">Track &amp; field champions:</p>
52+
<ul>
53+
<li>Adhemar da Silva</li>
54+
<li>Wang Junxia</li>
55+
<li>Wilma Rudolph</li>
56+
<li>Babe Didrikson-Zaharias</li>
57+
<li>Betty Cuthbert</li>
58+
<li>Fanny Blankers-Koen</li>
59+
<li>Florence Griffith-Joyner</li>
60+
<li>Irena Szewinska</li>
61+
<li>Jackie Joyner-Kersee</li>
62+
<li>Shirley Strickland</li>
63+
<li>Carl Lewis</li>
64+
<li>Emil Zatopek</li>
65+
<li>Haile Gebrselassie</li>
66+
<li>Jesse Owens</li>
67+
<li>Jim Thorpe</li>
68+
<li>Paavo Nurmi</li>
69+
<li>Sergei Bubka</li>
70+
<li class="[&:last-child]:hover-border-2px [&:last-child]:hover-border-solid [&:last-child]:hover-border-orange">Usain Bolt</li>
71+
</ul>
72+
</template>
73+
<style scoped></style>
74+
"
75+
`;

test/demo/test-vue-2.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ p {
3131
font-weight: bold;
3232
}
3333
34-
li:last-child:hover {
34+
p+ ul li:last-child:hover {
3535
border: 2px solid orange;
3636
}
3737
</style>

test/test-vue.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ describe('test-vue-1', async () => {
1414
})
1515

1616

17-
// describe('test-vue-2', async () => {
18-
// const demo = await fsp.readFile('./test/demo/test-vue-2.vue', 'utf-8')
19-
// const filepath = path.resolve(process.cwd(), './test/demo/test-vue-2.vue')
20-
// it('test-vue-2.vue', async () => {
21-
// expect(await transfromCode(demo, {filepath, type:'vue'})).toMatchSnapshot()
22-
// })
23-
// })
17+
describe('test-vue-2', async () => {
18+
const demo = await fsp.readFile('./test/demo/test-vue-2.vue', 'utf-8')
19+
const filepath = path.resolve(process.cwd(), './test/demo/test-vue-2.vue')
20+
it('test-vue-2.vue', async () => {
21+
expect(await transfromCode(demo, {filepath, type:'vue'})).toMatchSnapshot()
22+
})
23+
})

0 commit comments

Comments
 (0)