Skip to content

Commit

Permalink
修复用例
Browse files Browse the repository at this point in the history
  • Loading branch information
discreted66 committed Jan 15, 2025
1 parent f48712e commit 0fd79c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions examples/sites/demos/pc/app/date-picker/align.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ test('[DatePicker] 测试对齐方式', async ({ page }) => {
const leftDateInputDom = page.getByRole('textbox').nth(1)
const leftDatePanelDom = page.locator('.tiny-picker-panel').nth(2)
const leftClosePanel = page.getByText('左对齐:')
await page.waitForTimeout(200)
await page.waitForTimeout(400)

await leftDateInputDom.click()
await page.waitForTimeout(200)
await page.waitForTimeout(400)
await expect(leftDatePanelDom).toHaveAttribute('x-placement', /bottom-start|top-start/)
await leftClosePanel.click()

Expand All @@ -21,7 +21,7 @@ test('[DatePicker] 测试对齐方式', async ({ page }) => {
const centerClosePanel = page.getByText('居中对齐:')

await centerDateInputDom.click()
await page.waitForTimeout(200)
await page.waitForTimeout(400)
await expect(centerDatePanelDom).toHaveAttribute('x-placement', /bottom|top/)
await centerClosePanel.click()

Expand All @@ -31,7 +31,7 @@ test('[DatePicker] 测试对齐方式', async ({ page }) => {
const rightClosePanel = page.getByText('右对齐:')

await rightDateInputDom.click()
await page.waitForTimeout(200)
await page.waitForTimeout(400)
await expect(rightDatePanelDom).toHaveAttribute('x-placement', /bottom-end|top-end/)
await rightClosePanel.click()
})
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { mountPcMode } from '@opentiny-internal/vue-test-utils'
import { describe, expect, test } from 'vitest'
import { DatePanel } from '@opentiny/vue-date-panel'
import { ref } from 'vue'
import { nextTick } from 'vue'

describe('PC Mode', () => {
const mount = mountPcMode

test('static', () => {
test('static', async () => {
const wrapper = mount(DatePanel, {
props: {
modelValue: ref('2025-01-14'),
format: 'yyy-MMM-dd'
modelValue: '2025-01-14',
format: 'yyy-MM-dd'
}
})

expect(wrapper.classes()).toContain('tiny-picker-panel')
expect(wrapper.find('td .current').exists()).toBe(true)
await nextTick()
expect(wrapper.find('.current').exists()).toBe(true)
})
})

0 comments on commit 0fd79c8

Please sign in to comment.