Skip to content

fix(SendReceive.stories): stop eth price updates during chromatic snapshots #14946

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

Conversation

TylerAPfledderer
Copy link
Contributor

Description

For the SendReceive component, this adds a check for chromatic to use the Fallback eth price when rendering the calculated value during the Chromatic snapshots. This will prevent API updates that would otherwise run a new snapshot for multiple stories when chromatic runs.

Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 139a468
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/67cdc694e890520008fdf864
😎 Deploy Preview https://deploy-preview-14946--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 44 (🔴 down 14 from production)
Accessibility: 92 (no change from production)
Best Practices: 87 (🔴 down 8 from production)
SEO: 98 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

Approving as this fixes the problem in the short term but wondering if we couldn't make a mock for the fetch instead, to keep minimal side effects.

@pettinarip pettinarip merged commit 7d5880f into ethereum:dev Mar 10, 2025
8 of 9 checks passed
@TylerAPfledderer
Copy link
Contributor Author

TylerAPfledderer commented Mar 10, 2025

Approving as this fixes the problem in the short term but wondering if we couldn't make a mock for the fetch instead, to keep minimal side effects.

@pettinarip currently, I am not sure if there is a way to mock this, since the fetch data is internal via useEthPrice() with no props sent to it to manipulate. I can review Storybook docs to see if mocking is possible as is.

I could've put isChromatic() inside `useEthPrice() for cleaner code.

Either way, I'll make a note for follow-up, and then check with you on what I find.

@TylerAPfledderer TylerAPfledderer deleted the fix/SendReceive-story-prevent-num-updates branch March 10, 2025 17:50
This was referenced Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants