Sha256: 85d0391eb6b1d8f2c70b747c98c08a75e529a9ac7308e2b8dfd06fa74924427d

Contents?: true

Size: 968 Bytes

Versions: 25

Compression:

Stored size: 968 Bytes

Contents

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

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

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

suite.addBatch({
  "selectAll(div)": {
    topic: function() {
      return d3.select("body").html("").selectAll("div")
          .data([1, 2, 10, 20])
        .enter().append("div")
          .attr("id", String);
    },
    "orders elements by data": function(div) {
      div = div.data([1, 10, 20, 2], String).order();
      assert.domNull(div[0][0].previousSibling);
      assert.domEqual(div[0][1].previousSibling, div[0][0]);
      assert.domEqual(div[0][2].previousSibling, div[0][1]);
      assert.domEqual(div[0][3].previousSibling, div[0][2]);
      assert.domNull(div[0][3].nextSibling);
    },
    "returns the current selection": function(span) {
      span = d3.select("body"); // https://github.com/tmpvar/jsdom/issues/277
      assert.isTrue(span.order() === span);
    }
  }
});

suite.export(module);

Version data entries

25 entries across 25 versions & 1 rubygems

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