-
Notifications
You must be signed in to change notification settings - Fork 52
Add tests for Animate and RiverStoryScroll components #1123
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
base: main
Are you sure you want to change the base?
Conversation
|
🟢 No design token changes found |
8924872
to
d93787b
Compare
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
d93787b
to
f79ea5f
Compare
f79ea5f
to
d20002d
Compare
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.
Pull Request Overview
This PR adds comprehensive test coverage for the Animate and RiverStoryScroll components to achieve 100% test coverage. The tests cover component rendering, accessibility, animation behavior, responsive design, and edge cases.
Key changes:
- Added 417 lines of tests for RiverStoryScroll component covering scroll interactions, responsive behavior, and error handling
- Added 184 lines of tests for Animate component covering animation properties, element rendering, and prop handling
- Implemented comprehensive mocking for browser APIs and animation hooks
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/react/src/river/RiverStoryScroll/RiverStoryScroll.test.tsx | Complete test suite for RiverStoryScroll with intersection observer mocking, responsive tests, and edge case coverage |
packages/react/src/animation/Animate/Animate.test.tsx | Complete test suite for Animate component covering rendering, animation properties, and prop forwarding |
Comments suppressed due to low confidence (1)
packages/react/src/animation/Animate/Animate.test.tsx:64
- This test assumes that invalid 'as' props fall back to 'div', but without seeing the implementation, this behavior may not be guaranteed. The test should verify the actual fallback behavior implemented in the component rather than assuming it.
it('falls back to div when invalid as prop is provided', () => {
// @ts-expect-error Testing invalid prop
const {container} = render(<Animate as="invalid">Content</Animate>)
expect(container.firstChild?.nodeName).toBe('DIV')
})
Summary
Backfills tests for Animate and RiverStoryScroll components to bring coverage up to 100%.
Ref support has not been tested as neither RiverStoryScroll nor Animate support ref forwarding with
forwardRef
. Animate will support implicit ref forwarding when we update to React 19, however I don't foresee any issues in this case as we don't rely on a ref internally within the Animate component.Supporting resources (related issues, external links, etc)
Contributor checklist
update snapshots
label to the PR)Reviewer checklist