Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Adds test coverage for the date input empty string reset behavior addressed in #5440.

Changes

  • Added test in input.spec.tsx verifying DBInput with type="date" can be cleared by setting value to empty string
  • Test validates behavior matches native input[type="date"] element behavior
  • Added blob-report/ to .gitignore to exclude Playwright test artifacts

Test Case

test('should clear date input when value is set to empty string', async ({
  mount,
  page
}) => {
  const component = await mount(
    <DBInput label="Date" type="date" value="2025-01-15" />
  );
  const input = page.locator('input[type="date"]');
  
  await expect(input).toHaveValue('2025-01-15');
  
  // Simulate empty string reset
  await component.evaluate((node: any, newValue: string) => {
    const inputElement = node.querySelector('input');
    if (inputElement) {
      inputElement.value = newValue;
      inputElement.dispatchEvent(new Event('input', { bubbles: true }));
      inputElement.dispatchEvent(new Event('change', { bubbles: true }));
    }
  }, '');
  
  await expect(input).toHaveValue('');
});

💡 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: 0346ecd

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎁 Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants