ComponentTests
Sankey Chart – Component test plan
Sub-components: Node, Callout, Labels,
- Node: Node data, Node color, Node label
- Callout: Default callout
- Labels: Default labels
Test steps | Validation | Tool used |
---|---|---|
Test 1: [Snapshot testing] | ||
- With only data prop, string data as node ID. | Should render sankey chart with axis correctly | RTL |
- With only data prop, numeric data as node ID. | Should render sankey chart with axis correctly | Enzyme |
- With node color and border colors | Should render Sankey chart with specified node and border colors | Enzyme |
Test 2: Render calling with respective to props | ||
- No prop changes: Mount Sankey chart and then set the same props again | Render function should have been called twice | Enzyme |
- Prop changes: Mount Sankey chart and then set some other prop | Render function should have been called twice | Enzyme |
Test 3: Mouse events | ||
- Mouse over on a node | Should update Sankey chart correctly on mouseover | Enzyme |
- Mouse over on link | Should update Sankey chart correctly on mouseover | Enzyme |
- Mouse click on a node | Should update node and path color based on the link | RTL |
Test 4: [Sub-Component]: Node | ||
- Specify node color | Should render node with the specified color | Enzyme |
- With node description is large | Should render tooltip correctly when node description is large | Enzyme |
Test 5: [Sub-Component]: Callout | ||
- Hover mouse over a link to display callout | Should show the default callout over that link | Enzyme |
Test 6: [Sub-Component]: Labels | ||
- Set node name to “x” | Should render node name properly | RTL |
Test 7: Theme changed to Dark Theme | Should reflect theme change | RTL |