Skip to content

Commit

Permalink
fix(demos/checkbox): [checkbox] fix checkbox e2e-test error
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr committed Jan 6, 2025
1 parent 3683e48 commit f6fd147
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/checkbox-button.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div>
<tiny-checkbox-group v-model="checked" @change="valueChange">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('事件', async ({ page }) => {
const checkbox = demo.locator('.tiny-checkbox-group > label')

await checkbox.nth(1).click()
await expect(page.getByText('change 事件触发了,选中值为:复选框 1复选框 2')).toBeVisible()
await expect(page.getByText('change 事件触发了,选中值为:复选框 1,复选框 2')).toBeVisible()
await checkbox.nth(0).click()
await expect(page.getByText('change 事件触发了,选中值为:复选框 2')).toBeVisible()
})
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/checkbox-events.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked" @change="valueChange">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2"></tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/checkbox-group.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2"></tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checkedData">
<tiny-checkbox label="复选框1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框3" name="name3"></tiny-checkbox>
<tiny-checkbox label="复选框 1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框 3" name="name3"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/checkbox/checked.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checkedData">
<tiny-checkbox label="复选框1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框3" name="name3"></tiny-checkbox>
<tiny-checkbox label="复选框 1" name="name1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" name="name2" checked></tiny-checkbox>
<tiny-checkbox label="复选框 3" name="name3"></tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked" fill="#fa9841" text-color="#eee">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/checkbox/custom-color.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tiny-checkbox-group v-model="checked" fill="#fa9841" text-color="#eee">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框 2"></tiny-checkbox-button>
</tiny-checkbox-group>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2" text="复选框2文本"></tiny-checkbox>
<tiny-checkbox label="复选框3" text="复选框3">复选框 3 文本</tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" text="复选框 2 文本"></tiny-checkbox>
<tiny-checkbox label="复选框 3" text="复选框 3">复选框 3 文本</tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/checkbox/description.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<tiny-checkbox-group v-model="checked">
<tiny-checkbox label="复选框1"></tiny-checkbox>
<tiny-checkbox label="复选框2" text="复选框2文本"></tiny-checkbox>
<tiny-checkbox label="复选框3" text="复选框3">复选框 3 文本</tiny-checkbox>
<tiny-checkbox label="复选框 1"></tiny-checkbox>
<tiny-checkbox label="复选框 2" text="复选框 2 文本"></tiny-checkbox>
<tiny-checkbox label="复选框 3" text="复选框 3">复选框 3 文本</tiny-checkbox>
</tiny-checkbox-group>
</template>

Expand Down
2 changes: 1 addition & 1 deletion internals/playwright-config/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Config = ({ testDir, baseURL, storageState, devServerCommon }) =>
timeout: 30 * 1000,
expect: {
// 每个 expect() 用例最长时间。
timeout: 15 * 1000,
timeout: 8 * 1000,
toHaveScreenshot: {
maxDiffPixelRatio: 0.02
}
Expand Down

0 comments on commit f6fd147

Please sign in to comment.