Skip to content

tests: add missing snapshot and axe coverage for ActionMenu - #4538

Merged
khiga8 merged 6 commits into
mainfrom
kh-increase-axe-coverage-to-states
May 1, 2024
Merged

tests: add missing snapshot and axe coverage for ActionMenu#4538
khiga8 merged 6 commits into
mainfrom
kh-increase-axe-coverage-to-states

Conversation

@khiga8

@khiga8khiga8 commented Apr 26, 2024

Copy link
Copy Markdown
Contributor

Fixes: #4530

Changelog

I noticed that most of the snapshots test and axe scan coverage for ActionMenu are for the default closed state, which is just a button.

This PR adds an action to open the ActionMenu to ensure we're getting adequate visual regression and axe testing coverage, and regenerates the snapshots.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot

changeset-botBot commented Apr 26, 2024

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c15d0f9

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

@github-actions

github-actionsBot commented Apr 26, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js87.98 KB (0%)
packages/react/dist/browser.umd.js88.28 KB (0%)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-4538 April 26, 2024 20:16 Inactive
@khiga8
khiga8force-pushed the kh-increase-axe-coverage-to-states branch from fdf4f7d to 08e63e1CompareApril 26, 2024 20:22
@@ -36,30 +37,29 @@ test.describe('ActionMenu', () => {
test.describe(theme, () => {

@khiga8khiga8Apr 26, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I noticed that this test is under Inactive items but it's visiting the wrong ID, -links-and-actions which is actually a duplicate of another test. Updated!

@khiga8khiga8 added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 26, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4538 April 26, 2024 20:25 Inactive
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 26, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4538 April 26, 2024 20:35 Inactive
@khiga8khiga8 changed the title tests: add missing snapshot and axe coverage for open componenttests: add missing snapshot and axe coverage for ActionMenuApr 29, 2024
@khiga8
khiga8force-pushed the kh-increase-axe-coverage-to-states branch from c5cda68 to 65e5b1eCompareApril 29, 2024 12:50
@khiga8khiga8 added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 29, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4538 April 29, 2024 12:53 Inactive
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 29, 2024
@khiga8khiga8 added the skip changeset This change does not need a changelog label Apr 29, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4538 April 29, 2024 13:04 Inactive
@khiga8khiga8 added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 29, 2024
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 29, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4538 April 29, 2024 13:17 Inactive
@khiga8khiga8 added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 29, 2024
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Apr 29, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

The snapshots changed for ActionList bcuz Jonathan's profile picture changed 😅

@github-actions
github-actionsBottemporarily deployed to storybook-preview-4538 April 29, 2024 13:32 Inactive
@khiga8
khiga8 marked this pull request as ready for review April 29, 2024 13:34
@khiga8
khiga8 requested review from a team as code ownersApril 29, 2024 13:34
@khiga8
khiga8 requested a review from mperrottiApril 29, 2024 13:34
@khiga8

Copy link
Copy Markdown
ContributorAuthor

I'm assuming the failing tests are expected because the snapshots changed, and will need to be merged in for it to pass.

@joshblack

Copy link
Copy Markdown
Member

@khiga8 that's a great point about the CI failing, ideally with update snapshots it should go green before merging since it is checking in the correct images. It may be that there is something flakey going on here, will take a look tomorrow if that's okay 👀 Typically this comes up with animations but I think you have animation: 'disabled' when taking screenshots so I'm not sure what would be causing it here 🤔

await page.locator('button', {hasText: 'Open menu'}).waitFor()
await page.getByRole('button', {name: 'Open menu'}).click()
expect(await page.screenshot()).toMatchSnapshot(`ActionMenu.Inactive Items.${theme}.png`)
expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Aha! Thank you @joshblack! 🌟

@joshblack

Copy link
Copy Markdown
Member

bump @mperrotti when you have a sec to review 👀

@khiga8khiga8 added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label May 1, 2024
@khiga8
khiga8 added this pull request to the merge queueMay 1, 2024
Merged via the queue into main with commit c860b70May 1, 2024
@khiga8
khiga8 deleted the kh-increase-axe-coverage-to-states branch May 1, 2024 21:04
lukasoppermann pushed a commit that referenced this pull request May 3, 2024
* tests: add missing axe coverage for open ActionMenu
* Update test
* test(vrt): update snapshots
* test(vrt): update snapshots
* test(vrt): update snapshots
* test(ActionMenu): disable animations for snapshot test
---------
Co-authored-by: khiga8 <khiga8@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changesetThis change does not need a changelogupdate snapshots🤖 Command that updates VRT snapshots on the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tests] Ensure that axe calls are made on open state of the component

3 participants

@khiga8@joshblack@mperrotti