Skip to content

Add e2e tests for AnchoredOverlay #7641

Merged
siddharthkp merged 25 commits intomainfrom
anchored-overlay-e2e-tests
Mar 11, 2026
Merged

Add e2e tests for AnchoredOverlay #7641
siddharthkp merged 25 commits intomainfrom
anchored-overlay-e2e-tests

Conversation

@siddharthkp
Copy link
Copy Markdown
Member

@siddharthkp siddharthkp commented Mar 9, 2026

Rollout strategy

  • None; Only adding tests

Merge checklist

  • Added/updated tests

- Add VRT tests for all AnchoredOverlay stories (default, features, dev)
- Run each test with CSS anchor positioning feature flag on/off
@siddharthkp siddharthkp requested a review from a team as a code owner March 9, 2026 12:49
@siddharthkp siddharthkp self-assigned this Mar 9, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 9, 2026

⚠️ No Changeset found

Latest commit: db791d5

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

@siddharthkp siddharthkp added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 9, 2026
@github-actions github-actions bot added the staff Author is a staff member label Mar 9, 2026
@siddharthkp siddharthkp added the skip changeset This change does not need a changelog label Mar 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Playwright VRT coverage for AnchoredOverlay Storybook stories as a preparatory step for upcoming CSS anchor-positioning work.

Changes:

  • Introduces a new AnchoredOverlay Playwright test suite covering default, features, and dev stories.
  • Runs VRT snapshots across all supported themes.
  • Adds a second snapshot variant with primer_react_css_anchor_positioning enabled.

- Add viewport support for Fullscreen Variant (xs breakpoint)
- Add delay for Reposition dev stories
- Use .first() for button locator to handle multi-button stories
- Add 7 new feature stories: CenteredOnPage, AnchorPositionGrid, ScrollWithAnchor, WithinDialog, WithinNestedDialog, WithinDialogOverflowing, WithinStickyElement
- Add corresponding CSS styles for new stories
- Add e2e tests for all new stories with dialog/nested dialog support
@primer primer deleted a comment from Copilot AI Mar 9, 2026
@primer primer deleted a comment from Copilot AI Mar 9, 2026
@github-actions github-actions bot requested a deployment to storybook-preview-7641 March 9, 2026 13:37 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7641 March 9, 2026 13:47 Inactive
@siddharthkp siddharthkp added update snapshots 🤖 Command that updates VRT snapshots on the pull request and removed update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Mar 9, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7641 March 9, 2026 14:00 Inactive
@primer primer bot requested a review from a team as a code owner March 9, 2026 14:15
@siddharthkp siddharthkp added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 10, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7641 March 10, 2026 10:07 Inactive
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 10, 2026
Copy link
Copy Markdown
Contributor

@llastflowers llastflowers left a comment

Choose a reason for hiding this comment

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

Looks great! I left a couple small comments. Approving in advance so you won't be blocked ✨

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.

Just noticed this one is a bit weird; is this intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oops, not at all. This test is too wide for snapshotting. Removing it.

)
}

export const CenteredOnPage = () => {
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 left a comment on the corresponding snapshot, but also looking at this story, it seems a little bit off. The button isn't visible unless I zoom out a lot. Just wanted to confirm what the expected behavior is here!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, it's intentionally a really big story. Doesn't make for a good visual test though.

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.

Just a small thing, but I wonder if we would want to have this overlay on top of the header (in the z-index sense) instead of underneath it? 👀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We should, but that's the bug 😄 that Tyler is fixing with anchored position (next PR). I'm just making sure we have tests to not have any regressions

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.

Oh, ha! Makes sense 😂

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

Labels

integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants