-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interaction tests for pagelayout sticky #2224
Conversation
… pagelayout-sticky-prop
🦋 Changeset detectedLatest commit: 4d75e24 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
b2b7287
to
67c5a22
Compare
98e2008
to
4d75e24
Compare
import {within} from '@storybook/testing-library' | ||
import {expect} from '@storybook/jest' | ||
|
||
const meta: Meta = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we can move this meta data out of the interaction stories and can be shared? As PageLayout.stories.tsx using the same data.
expect(isInViewPort(paragraphRect)).toBe(true) | ||
const paragraph2 = await canvas.getByTestId('paragraph2') | ||
const paragraphRect2 = paragraph2.getBoundingClientRect() | ||
expect(isInViewPort(paragraphRect2)).toBe(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! 🙌🏼
This is great. Thank you for setting this up, @pksjce! A couple of questions:
|
I kinda messed up this branch badly. So I'll close this PR and open a new one. @colebemis - Thanks!
However, I have some hope that this is being improved. In storybook 7.0.0 versions, there's improvements like this storybookjs/storybook#18555 , which help us have more expressive data in that addon. I feel that the addon is still new and not so mature yet. |
Add a couple of interactive tests
To test this, check PageLayout/interactions.stories