Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Proposed changes

This PR adds test coverage for the date input empty string reset behavior from PR #5440 and addresses Playwright test artifact management.

resolves #5440 (related)

Types of changes

  • Refactoring (improvements to existing components or architectural decisions)
  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

Background

This PR initially attempted to add test coverage for the date input empty string reset behavior from PR #5440. After review and feedback from @mfranzke, the tests were identified as ineffective because they manipulated the DOM directly rather than properly testing React component behavior. The tests have been corrected to properly validate the fix.

Changes Made

  • Added test cases for date input empty string handling: Three new tests validate that DBInput components properly accept empty string values for date, datetime-local, and other time-related input types. Tests distinguish between undefined, null, and empty string values to ensure the fix from PR fix(dbinput): inserting an empty string doesn't reset date form fields #5440 works correctly.
  • Fixed test implementation: Updated tests to use proper React component remounting with new value props instead of direct DOM manipulation, ensuring they work correctly with React's controlled component model.
  • Added blob-report/ to .gitignore: When Playwright tests run with the blob reporter (used in CI environments), they generate artifacts in blob-report/ directories. These test artifacts should not be committed to the repository.

Test Status

All 11 tests now pass successfully:

The blob reporter configuration can be found in showcases/playwright.config.ts where it's enabled when process.env.CI is set.

❤️ Thank you!


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/copilot/sub-pr-5440

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

⚠️ No Changeset found

Latest commit: 890529f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Fix reset of date form fields in dbinput test: add verification for date input clearing with empty string Nov 11, 2025
Copilot AI requested a review from mfranzke November 11, 2025 17:49
Copilot finished work on behalf of mfranzke November 11, 2025 17:49
Copilot finished work on behalf of mfranzke November 11, 2025 19:06
Copilot AI requested a review from mfranzke November 11, 2025 19:06
@mfranzke mfranzke marked this pull request as ready for review November 11, 2025 19:14
@mfranzke mfranzke moved this from 🏗 In progress to 🎁 Ready for review in UX Engineering Team Backlog Nov 11, 2025
Copilot AI changed the title test: add verification for date input clearing with empty string chore: add blob-report to .gitignore for Playwright test artifacts Nov 12, 2025
Copilot finished work on behalf of mfranzke November 12, 2025 15:14
@mfranzke mfranzke changed the title chore: add blob-report to .gitignore for Playwright test artifacts chore: add test case Nov 12, 2025
@mfranzke
Copy link
Collaborator

@copilot the test now runs into a timeout. Please fix it and test it yourself previous to assuming your task is done.

Copy link
Contributor Author

Copilot AI commented Nov 17, 2025

@copilot the test now runs into a timeout. Please fix it and test it yourself previous to assuming your task is done.

Fixed in commit e516c72. The tests were failing (not timing out) because they tried to directly manipulate the component's value property, which doesn't work correctly in React's controlled component model. Updated the tests to properly remount the component with new value props. All 11 tests now pass successfully.

Copilot AI changed the title chore: add test case test: add test cases for date input empty string handling Nov 17, 2025
Copilot finished work on behalf of mfranzke November 17, 2025 07:46
@michaelmkraus michaelmkraus moved this from 🎁 Ready for review to 👀 Actively In Review in UX Engineering Team Backlog Nov 17, 2025
@michaelmkraus michaelmkraus moved this from 👀 Actively In Review to 🎶 Waiting for feedback in UX Engineering Team Backlog Nov 17, 2025
Base automatically changed from 5439-dbinput-inserting-an-empty-string-doesnt-empty-date-form-fields to main November 26, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎶 Waiting for feedback

Development

Successfully merging this pull request may close these issues.

3 participants