-
Notifications
You must be signed in to change notification settings - Fork 278
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): [pop-upload, file-upload] Fix e2e test case errors after internationalization #2847
Conversation
WalkthroughThe pull request involves minor modifications to two test specification files related to file upload functionality. In the first file, the text pattern for a file size locator is updated from Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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 (e2e) test cases for the Changes
|
@@ -5,7 +5,7 @@ test('SaaS 风格文件列表', async ({ page }) => { | |||
await page.goto('file-upload#upload-file-list-saas') | |||
|
|||
const upload = page.getByRole('button', { name: '文件上传' }) | |||
const lists = page.locator('div').filter({ hasText: /^test2\.doc删除16\.84M$/ }) | |||
const lists = page.locator('div').filter({ hasText: /^test2\.doc删除16\.84 MB$/ }) |
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 regular expression accurately reflects the intended internationalized format. The change from 16.84M
to 16.84 MB
should be consistent with the application's internationalization settings.
@@ -23,10 +23,10 @@ test('PopUpload 限制上传文件类型和大小', async ({ page }) => { | |||
const [fileChooser] = await Promise.all([page.waitForEvent('filechooser'), selectFilesBtn.click()]) | |||
await fileChooser.setFiles(path1) | |||
await uploadsBtn.click() | |||
await expect(alert.getByText('测试.jpg:上传文件大小超出限制')).toBeVisible() | |||
await expect(alert.getByText('测试.jpg: 上传文件大小超出限制')).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.
Verify that the space added after the colon in the alert text is consistent with the application's internationalization standards.
await fileChooser.setFiles(path2) | ||
await fileChooser.setFiles(path3) | ||
await expect(lists).toHaveCount(3) | ||
await uploadsBtn.click() | ||
await expect(alert.getByText('测试.svg:上传文件类型不匹配')).toBeVisible() | ||
await expect(alert.getByText('测试.svg: 上传文件类型不匹配')).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 space added after the colon in the alert text is consistent with the application's internationalization standards.
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 (1)
examples/sites/demos/pc/app/file-upload/upload-file-list-saas.spec.ts (1)
8-8
: Keep the file size notation consistent.The updated regex now matches
16.84 MB
instead of16.84M
, which appears more explicit for the file size. However, note that there's another occurrence of16.84M
in the regex fortest5超长...doc
(lines below). For clarity, consider using16.84 MB
consistently throughout the file:- /^test5超长...\.doc删除16\.84M$/ + /^test5超长...\.doc删除16\.84 MB$/
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/sites/demos/pc/app/file-upload/upload-file-list-saas.spec.ts
(1 hunks)examples/sites/demos/pc/app/pop-upload/file-type.spec.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- examples/sites/demos/pc/app/pop-upload/file-type.spec.ts
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