Skip to content

Commit

Permalink
Fix incorrect transition test exposed by d3-transition fix
Browse files Browse the repository at this point in the history
The original test was incorrect since it tried to reuse a transition
that had expired. This went unnoticed until
d3/d3-transition#59 was fixed.
  • Loading branch information
magjac committed Mar 30, 2021
1 parent 29c3598 commit 43858c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/transition-test.js
Expand Up @@ -42,6 +42,7 @@ tape("graphviz().render() adds and removes SVG elements after transition delay."
part1();
});

const transition2 = transition1 || d3_transition.transition().duration(1000);
function part1() {
graphviz
.tweenShapes(false)
Expand All @@ -65,6 +66,7 @@ tape("graphviz().render() adds and removes SVG elements after transition delay."
test.equal(d3.selectAll('ellipse').size(), 3, 'Number of initial ellipses');
test.equal(d3.selectAll('path').size(), 1, 'Number of initial paths');

const transition2 = transition1 || d3_transition.transition().duration(1000);
graphviz
.dot('digraph {a -> b; b -> a}')
.transition(transition1)
Expand Down Expand Up @@ -107,8 +109,7 @@ tape("graphviz().render() adds and removes SVG elements after transition delay."

function transition_instance_test() {
transition_test_init();
const transition1 = d3_transition.transition().duration(0);
transition_test(transition1, transition_function_test);
transition_test(null, transition_function_test);
}

function transition_function_test() {
Expand Down

0 comments on commit 43858c1

Please sign in to comment.