Skip to content

fix(text-editor): move unit tests to playwright#7736

Open
mihai-albu-sage wants to merge 1 commit intomasterfrom
FE-7497
Open

fix(text-editor): move unit tests to playwright#7736
mihai-albu-sage wants to merge 1 commit intomasterfrom
FE-7497

Conversation

@mihai-albu-sage
Copy link
Contributor

@mihai-albu-sage mihai-albu-sage commented Jan 27, 2026

Proposed behaviour

The TestEditor component, which was introduced to support Jest unit tests for TextEditor, has been removed. Tests now use TextEditor directly or wrap it with LexicalComposer where appropriate, while maintaining 100% code coverage.

In addition, multiple Playwright tests have been added for TextEditor to ensure its behavior is validated in a real browser environment. Some of the unit tests that were flaky and not required for the 100% code coverage have been moved to Playwright tests.

Current behaviour

Currently, the TestEditor component is used to support Jest unit tests, however, this approach is not always ideal, as it relies on a simplified version of the actual component. The Playwright tests can be improved to cover more functionality even if there is some overlap with the jest unit tests.

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

Testing instructions

open={hyperlinkDialogOpen}
onCancel={
/* istanbul ignore next */ () => {
// console.log('\n\n\n\n on cancel! \n\n\n\n')
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Looks like some commented out code left here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the commented out row.

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 Mihai, just a couple of questions on this, thanks.

@dariusbercea-sage dariusbercea-sage marked this pull request as ready for review February 6, 2026 09:07
@dariusbercea-sage dariusbercea-sage requested review from a team as code owners February 6, 2026 09:07
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.

4 participants