Skip to content

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

Merged
pettinarip merged 3 commits into
ethereum:devfrom
TylerAPfledderer:fix/SendReceive-story-prevent-num-updates
Mar 10, 2025
Merged

fix(SendReceive.stories): stop eth price updates during chromatic snapshots#14946
pettinarip merged 3 commits into
ethereum:devfrom
TylerAPfledderer:fix/SendReceive-story-prevent-num-updates

Conversation

@TylerAPfledderer
Copy link
Copy Markdown
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.

@netlify
Copy link
Copy Markdown

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
Copy Markdown
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
@TylerAPfledderer
Copy link
Copy Markdown
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