Skip to content

Commit

Permalink
Test transition.size.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jul 30, 2020
1 parent ca5ae84 commit 46027fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/transition/size-test.js
@@ -1,8 +1,16 @@
var tape = require("tape"),
jsdom = require("../jsdom"),
d3_selection = require("d3-selection"),
d3_transition = require("../../");

tape("transition.size is the same as selection.size", function(test) {
test.equal(d3_transition.transition.prototype.size, d3_selection.selection.prototype.size);
test.end();
});

tape("transition.size() returns the expected value", function(test) {
var root = jsdom().documentElement;
test.equal(d3_selection.select(root).transition().size(), 1);
test.equal(d3_selection.selectAll([null, root]).transition().size(), 1);
test.end();
});

0 comments on commit 46027fa

Please sign in to comment.