Skip to content

test(e2e): add cases for template conditional statements#5290

Merged
chenjiahan merged 2 commits intomainfrom
template_conditional_0521
May 21, 2025
Merged

test(e2e): add cases for template conditional statements#5290
chenjiahan merged 2 commits intomainfrom
template_conditional_0521

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

This pull request adds new E2E test cases for validating the rendering of conditional statements in HTML templates.

Checklist

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

Copilot AI review requested due to automatic review settings May 21, 2025 13:18
@netlify
Copy link
Copy Markdown

netlify bot commented May 21, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 0ac17cb
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/682dd353ec7be1000849aed3
😎 Deploy Preview https://deploy-preview-5290--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🟢 up 6 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
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 adds end-to-end test cases to verify various conditional statements in an HTML template.

  • Introduces a template with basic if, if/else, if/elseif/else, nested if, and conditional expression examples
  • Configures template parameters in rsbuild.config.ts to drive each conditional scenario
  • Implements Playwright tests asserting the presence or absence of specific rendered output

Reviewed Changes

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

File Description
e2e/cases/html/template-conditional-statement/src/index.html Added HTML examples for multiple conditional statements
e2e/cases/html/template-conditional-statement/rsbuild.config.ts Set up templateParameters for each test scenario
e2e/cases/html/template-conditional-statement/index.test.ts New Playwright tests to validate rendered conditional outputs
Comments suppressed due to low confidence (1)

e2e/cases/html/template-conditional-statement/index.test.ts:20

  • Only the value > 5 branch is tested here. Consider adding a separate test scenario where value <= 5 to verify the else branch renders correctly.
// if/else if/else statement (value: 7)

@chenjiahan chenjiahan merged commit 421af20 into main May 21, 2025
11 checks passed
@chenjiahan chenjiahan deleted the template_conditional_0521 branch May 21, 2025 13:27
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.

2 participants