-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
Looks good! 👍 Pretty cool how easy it was to drop this in, I figured it would require a lot more work! Pulled & tried the demo page, all seems to work fine. Re: integration tests, one possibility would be to write something that makes it easy to check the color of a given pixel in the canvas, since we're already doing a full render in PhantomJS instead of just checking HTML. Then we could do stuff like ensuring that the pixel where the corner of the bar is expected to be is actually the bar color, but the pixel above it is white. This gives us better assurances than the current unit tests - currently we're just checking that we have the right number of bars, while this would actually test that they are where they're supposed to be. |
What I really would like is screenshot / image diffing, but I haven't been able to find a good solution for that. I guess we could write a little wrapper for rendering a saved image to canvas and then |
That's a good idea. Those libraries look interesting, if we used one of those we may not even have to render the saved image to canvas. |
cc/ @baer if you want to test this out locally you will need to |
@@ -2,7 +2,7 @@ | |||
import _ from "lodash"; | |||
import React from "react"; | |||
import {VictoryBar} from "../src/index"; | |||
import {VictoryChart} from "victory-chart"; | |||
// import {VictoryChart} from "victory-chart"; |
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.
Is this intentional?
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.
yeah, I haven't updated victory-chart
to work with react-art
yet, so that is all temporarily broken
react work is postponed |
cc/ @dandelany
This PR switches to react-art
This PR relies on my fork of react-art until this issue / PR lands reactjs/react-art#83
depends on FormidableLabs/victory-label#32
I also decided to punt on integration tests for a moment. Testing canvas elements is not working out nicely. I want to add enzyme to help out, but I'm bumping up against this issue enzymejs/enzyme#47. I'm going to talk with @kenwheeler and @coopy about a strategy.