-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(e2e): [cascader,color-picker,crop] fix cascader color-picker crop components e2e-test error #2746
Conversation
WalkthroughThis pull request involves minor text formatting changes across multiple test files and component implementations, primarily focusing on the Cascader component and its related test cases. The modifications mainly include adjusting whitespace, removing or adding spaces between words and symbols, and updating text assertions to match precise formatting. These changes appear to be cosmetic and do not significantly alter the underlying functionality of the components or tests. Changes
Possibly related PRs
Suggested labels
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis pull request addresses errors in end-to-end tests for the cascader, color-picker, and crop components. The changes primarily involve correcting text expectations in test cases to ensure they match the actual output, thereby fixing the test failures. Changes
|
@@ -10,11 +10,12 @@ test('选中节点变化', async ({ page }) => { | |||
await page.getByRole('menuitem', { name: '安装' }).click() | |||
await page.getByRole('menuitem', { name: '项目登记' }).click() | |||
|
|||
await expect(page.getByText('change 事件,当前选中的值为:项目登记;传入的值为:zhinan,anzhuang,xiangmudengji')).toBeVisible() | |||
await expect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
await expect(page.getByText('指南自定义 (2) 组件自定义 (6)')).toBeVisible() | ||
await page.getByRole('menuitem', { name: '指南自定义 (2)' }).click() | ||
await expect(page.getByText('安装自定义 (4) 开发自定义 (2)')).toBeVisible() | ||
await expect(page.getByText('指南自定义(2)组件自定义(6)')).toBeVisible() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
@@ -17,7 +17,7 @@ const propsAuto = ref({ | |||
setTimeout(() => { | |||
const nodes = Array.from({ length: level + 1 }).map(() => ({ | |||
value: ++id, | |||
label: `选项${id}`, | |||
label: `选项 ${id}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
@@ -22,7 +22,7 @@ export default { | |||
setTimeout(() => { | |||
const nodes = Array.from({ length: level + 1 }).map(() => ({ | |||
value: ++id, | |||
label: `选项${id}`, | |||
label: `选项 ${id}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
@@ -17,7 +17,7 @@ const propsAuto = ref({ | |||
setTimeout(() => { | |||
const nodes = Array.from({ length: level + 1 }).map(() => ({ | |||
value: ++id, | |||
label: `选项${id}`, | |||
label: `选项 ${id}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
@@ -21,7 +21,7 @@ export default { | |||
setTimeout(() => { | |||
const nodes = Array.from({ length: level + 1 }).map(() => ({ | |||
value: ++id, | |||
label: `选项${id}`, | |||
label: `选项 ${id}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
@@ -4,7 +4,7 @@ test('可清空', async ({ page }) => { | |||
page.on('pageerror', (exception) => expect(exception).toBeNull()) | |||
await page.goto('cascader#clearable') | |||
const text = await page.getByRole('textbox', { name: '请选择' }).inputValue() | |||
await expect(text).toEqual('指南 + 安装 + 项目登记') | |||
await expect(text).toEqual('指南+安装+项目登记') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
@@ -4,7 +4,7 @@ test('多选', async ({ page }) => { | |||
page.on('pageerror', (exception) => expect(exception).toBeNull()) | |||
await page.goto('cascader#default-multiple') | |||
const multiple = page.locator('.tiny-cascader-multiple') | |||
const multipleText = page.getByText('指南 /安装 /项目登记指南 /安装 /安装 CLI 指南 /开发 /引入组件') | |||
const multipleText = page.getByText('指南 /安装 /项目登记指南 /安装 /安装 CLI指南 /开发 /引入组件') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
await page.getByText('取消选择预定义颜色 Append predefine').click() | ||
await page.getByText('取消选择预定义颜色 Append predefine').click() | ||
await page.getByText('取消选择预定义颜色 Append predefine').click() | ||
await page.getByText('取消选择预定义颜色Append predefine').click() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
@@ -7,5 +7,5 @@ test('获取裁剪后的图片数据', async ({ page }) => { | |||
await page.getByRole('button', { name: '获取裁剪后的图片数据' }).click() | |||
|
|||
// 待补充验证:弹窗内数据 | |||
await expect(page.getByText('Blob: 337877')).toHaveCount(1) | |||
await expect(page.getByText('Blob:337877')).toHaveCount(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the text expectations are correctly aligned with the actual output to avoid test failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
examples/sites/demos/pc/app/cascader/default-multiple.spec.ts (1)
7-7
: Verify the new text format for user clarity.The text
'安装 CLI指南'
merges "CLI" and "指南" without spacing, which might reduce clarity. Confirm that the UI labels reflect this format and won’t lead to user confusion.examples/sites/demos/pc/app/cascader/clearable.spec.ts (1)
7-7
: Check for consistency in label formatting.Removing the spaces from
'指南+安装+项目登记'
may serve a formatting purpose. Just ensure that similar references in the UI and other tests also omit these spaces to maintain uniformity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
examples/sites/demos/pc/app/cascader-panel/change.spec.ts
(1 hunks)examples/sites/demos/pc/app/cascader-panel/custom-option-content.spec.ts
(1 hunks)examples/sites/demos/pc/app/cascader/auto-load-checkStrictly-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/cascader/auto-load-checkStrictly.vue
(1 hunks)examples/sites/demos/pc/app/cascader/auto-load-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/cascader/auto-load.vue
(1 hunks)examples/sites/demos/pc/app/cascader/clearable.spec.ts
(1 hunks)examples/sites/demos/pc/app/cascader/default-multiple.spec.ts
(1 hunks)examples/sites/demos/pc/app/color-picker/predefine.spec.ts
(2 hunks)examples/sites/demos/pc/app/crop/get-cropped-canvas.spec.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (5)
- examples/sites/demos/pc/app/crop/get-cropped-canvas.spec.ts
- examples/sites/demos/pc/app/cascader/auto-load-composition-api.vue
- examples/sites/demos/pc/app/cascader/auto-load.vue
- examples/sites/demos/pc/app/cascader/auto-load-checkStrictly-composition-api.vue
- examples/sites/demos/pc/app/cascader/auto-load-checkStrictly.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (4)
examples/sites/demos/pc/app/cascader-panel/custom-option-content.spec.ts (1)
6-8
: Maintain consistent spacing for readability.The removed spaces in the text (e.g.,
'指南自定义(2)组件自定义(6)'
) might hamper quick readability. However, if consistency across the tests demands this removal, these changes are acceptable. Ensure that the text string matches the actual UI labels to avoid false test failures.examples/sites/demos/pc/app/cascader-panel/change.spec.ts (1)
13-15
: Approve text refinement for consistent punctuation.Using a full-width semicolon in the displayed text is fine, assuming it aligns with the standard textual conventions across the application.
examples/sites/demos/pc/app/color-picker/predefine.spec.ts (2)
11-11
: Ensure text alignment with the UI's actual wording.This change removes a space between Chinese text and English text. Please verify whether the UI label has been updated to reflect this same string; otherwise, the test may fail or become misleading.
26-26
: Double-check spacing for consistency with user-facing text.Similar to line 11, the space between Chinese and English text has been removed. Confirm that this clarifies rather than obscures the intended meaning, and that the UI label now omits the space as well.
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Style
Tests