File tree Expand file tree Collapse file tree 6 files changed +7
-19
lines changed
examples/sites/demos/pc/app Expand file tree Collapse file tree 6 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,7 @@ test('基本用法', async ({ page }) => {
16
16
// 更多按钮
17
17
await expect ( moreItem ) . toHaveText ( / 更 多 / )
18
18
// 图标显示
19
- await expect ( moreItem . locator ( 'svg > path' ) . nth ( 0 ) ) . toHaveAttribute (
20
- 'd' ,
21
- 'M8 11.43c-.15 0-.31-.06-.42-.18L1.92 5.6c-.23-.23-.23-.61 0-.85s.61-.23.85 0L8 9.98l5.23-5.23a.61.61 0 0 1 .85 0c.23.23.23.61 0 .85l-5.66 5.66c-.11.11-.27.17-.42.17z'
22
- )
19
+ await expect ( moreItem . locator ( '.tiny-dropdown__trigger .tiny-svg' ) ) . toBeVisible ( )
23
20
// 分割线
24
21
await expect ( actionMenu . locator ( '.tiny-action-menu__item-line' ) ) . toHaveCount ( 2 )
25
22
// 图标旋转
Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ test('基本用法', async ({ page }) => {
12
12
await expect ( visibleItem ) . toHaveCount ( 4 )
13
13
await expect ( moreItem ) . not . toHaveText ( / 更 多 / )
14
14
// 三点图标
15
- await expect ( moreItem . locator ( 'circle' ) ) . toHaveCount ( 3 )
15
+ const SvgPathReg = / ^ M 2 \. 3 7 \. 7 8 v .+ 2 1 9 - 1 \. 1 7 Z $ /
16
+ await expect ( moreItem . locator ( '.tiny-svg path' ) . first ( ) ) . toHaveAttribute ( 'd' , SvgPathReg )
16
17
} )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ test('只显示文本', async ({ page }) => {
24
24
await page . goto ( 'action-menu#icon' )
25
25
26
26
const wrap = page . locator ( '#icon' )
27
- const actionMenu = wrap . locator ( '.tiny-action-menu' ) . nth ( 2 )
27
+ const actionMenu = wrap . locator ( '.tiny-action-menu' ) . nth ( 1 )
28
28
const actionMenuItem = actionMenu . locator ( '.tiny-action-menu__item' )
29
29
30
30
await expect ( actionMenuItem . nth ( 0 ) . locator ( '.tiny-svg' ) ) . toBeHidden ( )
Original file line number Diff line number Diff line change @@ -22,6 +22,6 @@ test('测试更多按钮', async ({ page }) => {
22
22
// 判断图标是否正确
23
23
const moreButton = buttonGroup . getByRole ( 'button' ) . nth ( 3 )
24
24
const moreButtonSvg = moreButton . locator ( 'svg path' ) . first ( )
25
- const moreSvgPathReg = / ^ M 2 9 2 \. 7 6 8 4 4 9 \. 6 9 4 c 2 \. 4 9 1 \. 5 1 5 . + 0 0 2 - 1 2 . 5 5 5 - \. 0 0 2 z $ /
25
+ const moreSvgPathReg = / ^ M 2 \. 3 7 \. 7 8 v . + 2 1 9 - 1 \. 1 7 Z $ /
26
26
await expect ( moreButtonSvg ) . toHaveAttribute ( 'd' , moreSvgPathReg )
27
27
} )
Original file line number Diff line number Diff line change @@ -12,10 +12,7 @@ test('[DatePicker] 测试清除输入', async ({ page }) => {
12
12
// 默认显示清除按钮
13
13
await datePickerDefaultClearIcon . hover ( )
14
14
await expect ( clearIcon ) . toBeVisible ( )
15
- await expect ( clearIcon . locator ( 'path' ) . nth ( 1 ) ) . toHaveAttribute (
16
- 'd' ,
17
- 'M4.25 3.4 8 7.15l3.75-3.75a.61.61 0 0 1 .85 0c.23.23.23.62 0 .85L8.85 8l3.75 3.75c.23.24.23.62 0 .85a.61.61 0 0 1-.85 0L8 8.85 4.25 12.6a.61.61 0 0 1-.85 0 .592.592 0 0 1 0-.85L7.15 8 3.4 4.25a.61.61 0 0 1 0-.85.61.61 0 0 1 .85 0z'
18
- )
15
+ await expect ( clearIcon . locator ( 'path' ) . nth ( 0 ) ) . toHaveAttribute ( 'd' , / ^ M 1 2 \. 4 9 3 \. 3 a .+ 2 2 \. 7 1 0 Z $ / )
19
16
20
17
// 隐藏清除按钮
21
18
await datePickerHideClearIcon . hover ( )
@@ -24,10 +21,7 @@ test('[DatePicker] 测试清除输入', async ({ page }) => {
24
21
// 自定义清除图标
25
22
await datePickerCustomClearIcon . hover ( )
26
23
await expect ( clearIcon ) . toBeVisible ( )
27
- await expect ( clearIcon . locator ( 'path' ) . nth ( 1 ) ) . toHaveAttribute (
28
- 'd' ,
29
- 'M4.25 3.4 8 7.15l3.75-3.75a.61.61 0 0 1 .85 0c.23.23.23.62 0 .85L8.85 8l3.75 3.75c.23.24.23.62 0 .85a.61.61 0 0 1-.85 0L8 8.85 4.25 12.6a.61.61 0 0 1-.85 0 .592.592 0 0 1 0-.85L7.15 8 3.4 4.25a.61.61 0 0 1 0-.85.61.61 0 0 1 .85 0z'
30
- )
24
+ await expect ( clearIcon . locator ( 'path' ) . nth ( 0 ) ) . toHaveAttribute ( 'd' , / ^ M 1 2 \. 4 9 3 \. 3 a .+ 2 2 \. 7 1 0 Z $ / )
31
25
32
26
// 测试清除功能
33
27
await expect ( datePickerCustomClearIcon ) . toHaveValue ( '2023-05-24' )
Original file line number Diff line number Diff line change @@ -13,10 +13,6 @@ test('基本用法', async ({ page }) => {
13
13
14
14
// 箭头是否存在
15
15
await expect ( dropDownSvg ) . toBeVisible ( )
16
- await expect ( dropDownSvg . locator ( 'path' ) ) . toHaveAttribute (
17
- 'd' ,
18
- 'M8 11.43c-.15 0-.31-.06-.42-.18L1.92 5.6c-.23-.23-.23-.61 0-.85s.61-.23.85 0L8 9.98l5.23-5.23a.61.61 0 0 1 .85 0c.23.23.23.61 0 .85l-5.66 5.66c-.11.11-.27.17-.42.17z'
19
- )
20
16
21
17
await page . waitForTimeout ( 500 )
22
18
await dropDown . hover ( )
You can’t perform that action at this time.
0 commit comments