Sha256: 603265de7fc69f5dfc98a5b3d591d7fb02ae2af1427fd34c269007ffc574f2c0
Contents?: true
Size: 1.08 KB
Versions: 31
Compression:
Stored size: 1.08 KB
Contents
require("../env"); require("../../d3"); var vows = require("vows"), assert = require("assert"); var suite = vows.describe("d3.selection"); suite.addBatch({ "selection": { topic: function() { return d3.selection(); }, "selects the document": function(selection) { assert.equal(selection.length, 1); assert.equal(selection[0].length, 1); assert.equal(selection[0][0], document); }, "is an instanceof d3.selection": function(selection) { assert.isTrue(selection instanceof d3.selection); }, "subselections are also instanceof d3.selection": function(selection) { assert.isTrue(selection.select("body") instanceof d3.selection); assert.isTrue(selection.selectAll("body") instanceof d3.selection); }, "selection prototype can be extended": function(selection) { d3.selection.prototype.foo = function(v) { return this.attr("foo", v); }; selection.select("body").foo(42); assert.equal(document.body.getAttribute("foo"), "42"); delete d3.selection.prototype.foo; } } }); suite.export(module);
Version data entries
31 entries across 31 versions & 2 rubygems