Fix some potential race conditions in tests.
Unless .html("") is called on d3.select("body"), elements appended by another test could interfere with data binding. See #329.
This commit is contained in:
Родитель
9edd4bc058
Коммит
b9db0585cb
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
tt = [],
|
||||
vv = [];
|
||||
|
||||
var s = d3.select("body").append("div").selectAll("div")
|
||||
var s = d3.select("body").html("").append("div").selectAll("div")
|
||||
.data(["red", "green"])
|
||||
.enter().append("div")
|
||||
.attr("color", function(d) { return d3.rgb(d)+""; });
|
||||
|
|
|
@ -7,7 +7,7 @@ module.exports = {
|
|||
"start": {
|
||||
topic: function() {
|
||||
var cb = this.callback,
|
||||
div = d3.select("body").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
|
||||
div = d3.select("body").html("").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
|
||||
transition = div.transition().delay(150),
|
||||
then = Date.now(),
|
||||
n = 0,
|
||||
|
@ -79,7 +79,7 @@ module.exports = {
|
|||
"end": {
|
||||
topic: function() {
|
||||
var cb = this.callback,
|
||||
div = d3.select("body").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
|
||||
div = d3.select("body").html("").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
|
||||
transition = div.transition().duration(150),
|
||||
then = Date.now(),
|
||||
n = 0,
|
||||
|
|
|
@ -12,7 +12,7 @@ module.exports = {
|
|||
vv = [],
|
||||
fails = 0;
|
||||
|
||||
var s = d3.select("body").append("div").selectAll("div")
|
||||
var s = d3.select("body").html("").append("div").selectAll("div")
|
||||
.data(["red", "green"])
|
||||
.enter().append("div")
|
||||
.style("background-color", function(d) { return d3.rgb(d)+""; });
|
||||
|
|
Загрузка…
Ссылка в новой задаче