Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/base-select/all-text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ test('多选时自定义全部的文本', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('base-select#all-text')
const wrap = page.locator('#all-text')
const select = wrap.locator('.tiny-base-select').nth(0)
const select = wrap.locator('.tiny-base-select')
const dropdown = page.locator('body > .tiny-select-dropdown')
const option = dropdown.locator('.tiny-option')

await select.locator('.tiny-input__suffix').click()
await select.click()
await expect(option.filter({ hasText: '全部小吃' })).toHaveCount(1)
})
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/base-select/basic-usage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test('基础用法标签式', async ({ page }) => {
await input.click()
await option.filter({ hasText: '天津' }).click()
await expect(input).toHaveValue('天津')
await select.locator('.tiny-input__suffix svg').click()
await input.click()
await expect(page.getByRole('listitem').filter({ hasText: '天津' })).toHaveClass(/selected/)
await option.filter({ hasText: '深圳' }).click()
await expect(input).toHaveValue('深圳')
Expand All @@ -35,7 +35,7 @@ test('基础用法配置式', async ({ page }) => {
await input.click()
await option.filter({ hasText: '天津' }).click()
await expect(input).toHaveValue('天津')
await select.locator('.tiny-input__suffix svg').click()
await input.click()
await expect(page.getByRole('listitem').filter({ hasText: '天津' })).toHaveClass(/selected/)
await option.filter({ hasText: '深圳' }).click()
await expect(input).toHaveValue('深圳')
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/base-select/clearable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('clearable', async ({ page }) => {
await icon.click()
await expect(input).toHaveValue('')
// 验证选中
await icon.click()
await input.click()
await dropdown.getByRole('listitem').filter({ hasText: '上海' }).click()
await expect(input).toHaveValue('上海')
})
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ test('下划线默认', async ({ page }) => {
await expect(input).toHaveCSS('border-left-width', '0px')
await expect(input).toHaveCSS('border-right-width', '0px')
await expect(input).toHaveCSS('border-bottom-color', 'rgb(194, 194, 194)')
await expect(select.locator('svg')).toHaveCSS('fill', 'rgb(128, 128, 128)')

await select.click()
await option.first().click()
Expand All @@ -36,7 +35,6 @@ test('下划线禁用', async ({ page }) => {
await expect(input).toHaveCSS('border-right-width', '0px')
await expect(input).toHaveCSS('border-bottom-color', 'rgb(219, 219, 219)')
await expect(input).toHaveCSS('cursor', 'not-allowed')
await expect(select.locator('svg')).toHaveCSS('fill', 'rgb(194, 194, 194)')
const hasDisabled = await input.evaluate((input) => input.hasAttribute('disabled'))
await expect(hasDisabled).toBe(true)

Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/base-select/multiple.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('多选时取远端数据与当前已选数据的并集', async ({ page })
const tag = select.locator('.tiny-tag')

await expect(tag).toHaveCount(2)
await select.locator('.tiny-input__suffix').click()
await select.click()
await option.filter({ hasText: '全部' }).click()
await expect(tag).toHaveCount(7)
await option.filter({ hasText: '全部' }).click()
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/base-select/searchable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test('searchable-single', async ({ page }) => {
})
await option.filter({ hasText: '上海' }).click()
await page.waitForTimeout(500)
await expect(input).toHaveValue('')
await expect(input).toHaveValue('上海')
})

test('searchable-multiple', async ({ page }) => {
Expand Down
Loading
Loading