Skip to content

test(link): refine testing suite#7856

Merged
paulrobinson88 merged 2 commits intomasterfrom
FE-6483-link-tests
Apr 9, 2026
Merged

test(link): refine testing suite#7856
paulrobinson88 merged 2 commits intomasterfrom
FE-6483-link-tests

Conversation

@paulrobinson88
Copy link
Copy Markdown
Contributor

Proposed behaviour

  • Removes duplicate or unnecessary tests from the Playwright file

Current behaviour

  • There are a number of tests in the Playwright file which are either duplicated elsewhere in the testing suite or no longer needed causing slow run time of the build.

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

Ensure Playwright tests pass

Copy link
Copy Markdown
Contributor

@nuria1110 nuria1110 left a comment

Choose a reason for hiding this comment

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

Nice work simplifying our snapshots!

Comment thread src/components/link/link.stories.tsx Outdated
component: Link,
parameters: {
themeProvider: { chromatic: { theme: "sage" } },
themeProvider: { chromatic: { disableSnapshot: true }, theme: "sage" },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure the structure is correct here, I believe the chromatic config to disable the snapshot has to be done separately and not within the themeProvider:

Suggested change
themeProvider: { chromatic: { disableSnapshot: true }, theme: "sage" },
themeProvider: { chromatic: { theme: "sage" } },
chromatic: { disableSnapshot: false },

@paulrobinson88 paulrobinson88 force-pushed the FE-6483-link-tests branch 2 times, most recently from 4e52c43 to 7662ade Compare April 1, 2026 12:29
nuria1110
nuria1110 previously approved these changes Apr 1, 2026
Comment thread src/components/link/link.pw.tsx Outdated
await expect(linkElement).toHaveAttribute("href", testPlaywright);
});

test("should render with tooltipMessage prop", async ({ mount, page }) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

non-blocking: considering this is the only pw test remaining other than accessibility, do you think you can also add this to the all types story that was expanded? and use a target to hover?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, couldn't get the tooltip to show using pseudo within the test stories so had to add as an interaction story to one of the ones already snapshotted but unable to consolidate them further.

@paulrobinson88 paulrobinson88 marked this pull request as ready for review April 9, 2026 09:03
@paulrobinson88 paulrobinson88 requested review from a team as code owners April 9, 2026 09:03
@paulrobinson88 paulrobinson88 merged commit d1b5d46 into master Apr 9, 2026
28 checks passed
@paulrobinson88 paulrobinson88 deleted the FE-6483-link-tests branch April 9, 2026 09:22
@carbonci
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 158.41.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

5 participants