describe("loadBranch()", function() {
    beforeEach(function() {
    this.newRows = "<tr data-tt-id='3' data-tt-parent-id='2'><td>N3</td></tr><tr data-tt-id='4' data-tt-parent-id='2'><td>N4</td></tr>"
    - this.moreRows = "<tr data-tt-id='5' data-tt-parent-id='2'><td>N5</td></tr>"
    + this.moreRows = "<tr data-tt-id='5' data-tt-parent-id='2'><td>N5</td></tr>";
     
    this.subject.treetable();
    this.parentNode = this.subject.treetable("node", 2);
  @@ -276,9 +276,32 @@
    expect(this.subject.data("treetable").tree[4]).to.be.defined;
    });
     
    + it("registers nodes", function() {
    + expect(this.subject.data("treetable").nodes.length).to.equal(3);
    + this.subject.treetable("loadBranch", this.parentNode, this.newRows);
    + expect(this.subject.data("treetable").nodes.length).to.equal(5);
    + });
    +
    it("maintains chainability", function() {
    expect(this.subject.treetable("loadBranch", this.parentNode, this.newRows)).to.equal(this.subject);
    });
    +
    + describe("adding nodes at root level", function() {
    + beforeEach(function() {
    + this.rootRows = "<tr data-tt-id='6'><td>N6</td></tr>";
    + });
    +
    + it("registers nodes as root nodes", function () {
    + expect(this.subject.data("treetable").roots.length).to.equal(1);
    + this.subject.treetable("loadBranch", null, this.rootRows);
    + expect(this.subject.data("treetable").roots.length).to.equal(2);
    + });
    +
    + it("inserts rows into DOM", function () {
    + this.subject.treetable("loadBranch", null, this.rootRows);
    + expect($(this.subject[0].rows[3]).data("ttId")).to.equal(6);
    + });
    + });
    });
     

treetable adding nodes at root level的更多相关文章

  1. logback root level logger level 日志级别覆盖?继承?

    1. logback-spring.xml 配置 <appender name="STDOUT" class="ch.qos.logback.core.Consol ...

  2. Leetcode之深度优先搜索(DFS)专题-1080. 根到叶路径上的不足节点(Insufficient Nodes in Root to Leaf Paths)

    Leetcode之深度优先搜索(DFS)专题-1080. 根到叶路径上的不足节点(Insufficient Nodes in Root to Leaf Paths) 这篇是DFS专题的第一篇,所以我会 ...

  3. C# UTF8的BOM导致XML序列化与反序列化报错:Data at the root level is invalid. Line 1, position 1.

    最近在写一个xml序列化及反序列化实现时碰到个问题,大致类似下面的代码: class Program { static void Main1(string[] args) { var test = n ...

  4. 【leetcode】1080. Insufficient Nodes in Root to Leaf Paths

    题目如下: Given the root of a binary tree, consider all root to leaf paths: paths from the root to any l ...

  5. Data Structure Binary Tree: Connect nodes at same level using constant extra space

    http://www.geeksforgeeks.org/connect-nodes-at-same-level-with-o1-extra-space/ recursive: #include &l ...

  6. C# LoadXml System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

    去掉BOM头 writer = new XmlTextWriter(stream, new UnicodeEncoding(false,false)); 如果是UTF8 writer = new Xm ...

  7. LintCode Binary Tree Level Order Traversal

    Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...

  8. [LeetCode]题解(python):107 Binary Tree Level Order Traversal II

    题目来源 https://leetcode.com/problems/binary-tree-level-order-traversal-ii/ Given a binary tree, return ...

  9. [LeetCode]题解(python):103 Binary Tree Zigzag Level Order Traversal

    题目来源 https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ Given a binary tree, re ...

随机推荐

  1. mysql改动默认的环境的字符集为utf-8

    mysql改动环境的默认字符集为utf-8(当然你也能够设置成别的,国际点还是utf-8好) 假设不把mysql字符集统一下.后面还是有点麻烦的 首先得在服务里关掉mysql的服务(一定要先关掉mys ...

  2. storm与hadoop的对照

       hadoop 是实现了 mapreduce 的思想,将数据切片计算来处理大量的离线数据. hadoop处理的数据必须是已经存放在 hdfs 上或者类似 hbase 的数据库中.所以 hadoop ...

  3. Java String常见问题

    一.怎样推断两个String是否相等??使用"=="还是使用"equals()"? 对String来说."=="是用来推断两个字符串(对象) ...

  4. 2015/12/30 字符集 ASCII 到Unicode

    ——每个软件开发人员应该无条件掌握的知识! ——Unicode伟大的创想! 相信大家一定碰到过,打开某个网页,却显示一堆像乱码,如"бЇЯАзЪСЯ"."�??????? ...

  5. 危险的input 微博的过去

    更改uid post地址不变

  6. Resharper 实现接口的方式

  7. 利用JFreeChart生成多轴图表(7) (转自 JSP开发技术大全)

    利用JFreeChart生成多轴图表(7) (转自 JSP开发技术大全) 14.7 利用JFreeChart生成多轴图表 通过JFreeChart插件还可以生成拥有多个坐标轴的图表,简称多轴图表.在生 ...

  8. SqlServer数据库性能优化详解

    数据库性能优化详解 性能调节的目的是通过将网络流通.磁盘 I/O 和 CPU 时间减到最小,使每个查询的响应时间最短并最大限度地提高整个数据库服务器的吞吐量.为达到此目的,需要了解应用程序的需求和数据 ...

  9. 通过usb访问mtp设备(ubuntu12.04) (转载)

    转自:http://robert.penz.name/658/howto-access-mtp-devices-via-usb-on-ubuntu-12-04/ A friend asked me h ...

  10. url中传参数为中文的转码与解码解决方法

    1.转码 中文为 “你好”  var ProjectName = encodeURI(encodeURI("你好"));,如下图所示 跳转页面  window.location.h ...