Skip to content

Commit 7b8c456

Browse files
committed
用例补全
1 parent a7da1c9 commit 7b8c456

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

examples/sites/demos/pc/app/date-panel/shortcuts-composition-api.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="demo-date-panel-wrap">
3-
<div>{{ value }}</div>
3+
<div class="value">{{ value }}</div>
44
<tiny-date-panel v-model="value" :shortcuts="shortcuts"></tiny-date-panel>
55
</div>
66
</template>
@@ -15,7 +15,6 @@ const shortcuts = [
1515
text: '今天',
1616
onClick(picker) {
1717
const date = new Date()
18-
console.info(picker)
1918
picker.$emit('pick', date)
2019
}
2120
},
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { test, expect } from '@playwright/test'
22

3-
test('[DatePanel] 测试周次序号', async ({ page }) => {
3+
test('[DatePanel] 测试快捷选项', async ({ page }) => {
44
page.on('pageerror', (exception) => expect(exception).toBeNull())
55
await page.goto('date-panel#shortcuts')
6+
7+
const valueDom = page.locator('.value')
8+
await page.getByRole('button', { name: '今天' }).click()
9+
await page.getByRole('button', { name: '昨天' }).click()
10+
await page.getByRole('button', { name: '一周前' }).click()
11+
12+
await expect(valueDom).not.toHaveText('')
613
})

examples/sites/demos/pc/app/date-panel/shortcuts.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="demo-date-panel-wrap">
3-
<div>{{ value }}</div>
3+
<div class="value">{{ value }}</div>
44
<tiny-date-panel v-model="value" :shortcuts="shortcuts"></tiny-date-panel>
55
</div>
66
</template>
@@ -15,7 +15,6 @@ const shortcuts = [
1515
text: '今天',
1616
onClick(picker) {
1717
const date = new Date()
18-
console.info(picker)
1918
picker.$emit('pick', date)
2019
}
2120
},

0 commit comments

Comments
 (0)