Sha256: de9c1315c8d89d0c052768722a27941e1da7484071e7651549b1014637d9cbc4

Contents?: true

Size: 780 Bytes

Versions: 4

Compression:

Stored size: 780 Bytes

Contents

var assert = require("../assert");

module.exports = {
  topic: function(d3) {
    return d3.select("body").append("div").text("foo").transition().text("bar");
  },
  "sets the text tween": function(div) {
    assert.typeOf(div.tween("text"), "function");
  },
  "start": {
    topic: function(div) {
      var cb = this.callback,
          tween = div.tween("text");
      div.tween("text", function() {
        var result = tween.apply(this, arguments);
        cb(null, {transition: div, tween: result});
        return result;
      });
    },
    "sets the text content as a string": function(result) {
      assert.equal(result.transition[0][0].textContent, "bar");
    },
    "does not interpolate text": function(result) {
      assert.isTrue(!result.tween);
    }
  }
};

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
stripchart-0.0.3 lib/stripchart/public/components/d3/test/transition/transition-test-text.js
stripmem-0.0.3 lib/stripmem/public/components/d3/test/transition/transition-test-text.js
stripmem-0.0.2 lib/stripmem/public/components/d3/test/transition/transition-test-text.js
stripmem-0.0.1 lib/stripmem/public/components/d3/test/transition/transition-test-text.js