Skip to content

Conversation

@divyajindel
Copy link
Contributor

@divyajindel divyajindel commented Feb 6, 2026

Proposed behaviour

Eliminated all Playwright tests in badge.pw.tsx except accessibility tests, and added missing test coverage to the Jest test file.

Current behaviour

A number of tests are present in multiple test suites, and certain flaky tests may cause failures or substantially increase execution time.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

This should significantly reduce the amount of time taken for Playwright test to run in the Badge component without losing any coverage in Jest.

Testing instructions

Ensure the Playwright tests pass and Chromatic snapshots are correct.

Copy link
Contributor

@paulrobinson88 paulrobinson88 left a comment

Choose a reason for hiding this comment

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

Hi Divya, good work on this, just one comment from me.
Thanks.

});
});

test("should render with correct styles when onClick is passed and Badge is hovered", async ({
Copy link
Contributor

Choose a reason for hiding this comment

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

comment: This test appears to check that the correct badge and cross styles are applied when using an onClick and the badge is hovered. The Jest test does cover that the cross is rendered but the styles aren't checked. We may want to either add this into Jest, or potentially create an interaction test which could check via a snapshot.
However, as the onClick is deprecated it may not be required, I'll revert to whatever the other reviewer thinks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants