Skip to content

Commit

Permalink
fix(tree): fix e2e error
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjunjian committed Sep 14, 2024
1 parent cb3c0b4 commit 9ad105e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions examples/sites/demos/pc/app/tree/icons.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ test('测试自定义图标', async ({ page }) => {
const tree2 = preview.locator('.tiny-tree').nth(1)

const icon1 = tree1.locator('svg path').nth(0)
const icon2 = tree2.locator('svg path').nth(0)
const icon2 = tree2.locator('svg').nth(0)

// 测试tree1
await expect(tree1.getByText('数据 2')).toHaveCount(1)
await expect(icon1).toHaveAttribute('d', 'm6 2 13 10L6 22V2zm2 4v12l8-6.1L8 6z')
await expect(icon2).toHaveClass(/tiny-tree-node__expand-icon/)

// 测试tree2
await expect(tree2.getByText('数据 2')).toHaveCount(1)
await expect(icon2).toHaveAttribute(
'd',
'M13 11h4c.6 0 1 .4 1 1s-.4 1-1 1h-4v4c0 .6-.4 1-1 1s-1-.4-1-1v-4H7c-.6 0-1-.4-1-1s.4-1 1-1h4V7c0-.6.4-1 1-1s1 .4 1 1v4zM3 1h18c.9 0 2 1.1 2 2v18c0 .9-1 2-2 2H3c-.9 0-2-1.1-2-2V3c0-.9 1.1-2 2-2zm0 2v18h18V3H3z'
)
await expect(icon2).toHaveCSS('fill', 'rgb(255, 0, 0)')
await expect(icon2).toHaveClass(/tiny-tree-node__expand-icon/)
})
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/tree/props.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ test('测试自定义映射列', async ({ page }) => {
await expect(tree.getByText('数据 1-1-1')).toHaveCount(1)

// 测试disabled
await expect(tree.getByText('数据 2-2')).toHaveCSS('color', 'rgb(173, 176, 184)')
await expect(tree.getByText('数据 2-2')).toHaveCSS('color', 'rgb(194, 194, 194)')
})
2 changes: 1 addition & 1 deletion packages/theme/src/tree/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
// small尺寸节点高度
--ti-tree-small-node-content-height: calc(var(--ti-common-space-base, 4px) * 7);
// small尺寸节点高度
--ti-tree-small-node-font-size: var(--ti-common-line-height-base, 12px);
--ti-tree-small-node-font-size: 12px;

// 平铺模式节点高度
--ti-tree-plain-node-height: calc(var(--ti-common-space-base, 4px) * 7);
Expand Down

0 comments on commit 9ad105e

Please sign in to comment.