Skip to content

Comments

test: simplify assertions in SSR tests#7013

Merged
chenjiahan merged 1 commit intomainfrom
test_assetions_0122
Jan 22, 2026
Merged

test: simplify assertions in SSR tests#7013
chenjiahan merged 1 commit intomainfrom
test_assetions_0122

Conversation

@chenjiahan
Copy link
Member

Summary

  • Updated SSR-related tests to use page.locator('body') with toContainText for verifying the presence of "Rsbuild with React" instead of checking the response text directly.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 22, 2026 10:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies SSR-related test assertions by replacing direct response text checks with Playwright's page.locator('body').toContainText() matcher, making the tests more aligned with typical Playwright testing patterns.

Changes:

  • Updated SSR test assertions in e2e/cases/server/ssr/index.test.ts to use page.locator('body').toContainText() instead of checking response text with regex
  • Updated custom server test assertions in e2e/cases/server/custom-server/index.test.ts using the same approach

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
e2e/cases/server/ssr/index.test.ts Replaced 5 instances of res?.text().toMatch(/Rsbuild with React/) with page.locator('body').toContainText('Rsbuild with React') across multiple SSR test cases
e2e/cases/server/custom-server/index.test.ts Replaced 2 instances of res?.text().toBe('Hello polka!') with page.locator('body').toContainText('Hello polka!') in custom server tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 3a39c64 into main Jan 22, 2026
13 checks passed
@chenjiahan chenjiahan deleted the test_assetions_0122 branch January 22, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant