Sha256: 7f9625c05040b2370616c77774a1558ba4b1eda99b9fd52e53b67b89bd5c1dc2

Contents?: true

Size: 1.28 KB

Versions: 31

Compression:

Stored size: 1.28 KB

Contents

require("../env");
require("../../d3");

var vows = require("vows"),
    assert = require("assert");

var suite = vows.describe("selection.empty");

suite.addBatch({
  "select(body)": {
    topic: function() {
      return d3.select("body").html("");
    },
    "returns true for empty selections": function(body) {
      assert.isTrue(body.select("foo").empty());
    },
    "returns false for non-empty selections": function(body) {
      assert.isFalse(body.empty());
    },
    "ignores null nodes": function(body) {
      var some = d3.select("body");
      some[0][0] = null;
      assert.isTrue(some.empty());
    }
  }
});

suite.addBatch({
  "selectAll(div)": {
    topic: function() {
      var body = d3.select("body").html("");
      body.append("div").append("span");
      body.append("div");
      return body.selectAll("div");
    },
    "returns true for empty selections": function(div) {
      assert.isTrue(div.select("foo").empty());
    },
    "returns false for non-empty selections": function(div) {
      assert.isFalse(div.empty());
      assert.isFalse(div.select("span").empty());
    },
    "ignores null nodes": function(div) {
      var some = d3.selectAll("div");
      some[0][0] = null;
      assert.isTrue(some.select("span").empty());
    }
  }
});

suite.export(module);

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
picky-statistics-4.5.0 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.4.2 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.4.1 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.4.0 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.3.2 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.3.1 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.3.0 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.2.4 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.2.3 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.2.2 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.2.1 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.2.0 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.1.0 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.0.9 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.0.8 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.0.7 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.0.6 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.0.5 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.0.4 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js
picky-statistics-4.0.3 lib/picky-statistics/application/javascripts/d3/test/core/selection-empty-test.js