[ColorSync][Plotter] Add Plotter visual regression stories#3849
[ColorSync][Plotter] Add Plotter visual regression stories#3849nishasy wants to merge 4 commits into
Conversation
…ion stories There are no visual regression stories for Plotter yet. Adding them here. Initial State stories: - Bar chart - Bar chart mobile - Dot plot - Line plot - Line plot mobile - Histogram - Pictograph (with sample Earth image) Interactions: - none recommended Issue: https://khanacademy.atlassian.net/browse/LEMS-4296 Test plan: Storybook - `/?path=/story/widgets-plotter-visual-regression-tests-initial-state--bar-chart`
…er visual regression stories
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (14317f5) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3849If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3849If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3849 |
|
Size Change: +46 B (+0.01%) Total Size: 517 kB 📦 View Changed
ℹ️ View Unchanged
|
| // Raphael). Wait until at least one is present in the DOM. | ||
| await waitFor(() => { | ||
| if (canvasElement.querySelectorAll("image").length === 0) { | ||
| throw new Error("Pictograph images have not rendered yet"); |
There was a problem hiding this comment.
Would this fail if there is legitimately no images to render? Not sure if the images exist as a preload before you could drag columns up and down but if the default values happened to [0,0,0,0] would that fail?
There was a problem hiding this comment.
It would look normal in manual storybook, but the Chromatic snapshot would show it as blank, since it would take the screenshot before the image has time to load.
Summary:
There are no visual regression stories for Plotter yet. Adding them here. Also adding a generator function for Plotter to use within the renderer decorator.
Initial State stories:
Interactions:
Issue: https://khanacademy.atlassian.net/browse/LEMS-4296
Test plan:
Storybook
/?path=/story/widgets-plotter-visual-regression-tests-initial-state--bar-chart