Sha256: 2f157f59f676c72421730b4d16885f10facd361f8f44653b492354faa1dc9bcc

Contents?: true

Size: 1.49 KB

Versions: 57

Compression:

Stored size: 1.49 KB

Contents

describe("ResultsNode", function() {
  it("wraps a result", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      node = new j$.ResultsNode(fakeResult, "suite", null);

    expect(node.result).toBe(fakeResult);
    expect(node.type).toEqual("suite");
  });

  it("can add children with a type", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      fakeChildResult = {
        id: 456,
        message: "bar"
      },
      node = new j$.ResultsNode(fakeResult, "suite", null);

    node.addChild(fakeChildResult, "spec");

    expect(node.children.length).toEqual(1);
    expect(node.children[0].result).toEqual(fakeChildResult);
    expect(node.children[0].type).toEqual("spec");
  });

  it("has a pointer back to its parent ResultNode", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      fakeChildResult = {
        id: 456,
        message: "bar"
      },
      node = new j$.ResultsNode(fakeResult, "suite", null);

    node.addChild(fakeChildResult, "spec");

    expect(node.children[0].parent).toBe(node);
  });

  it("can provide the most recent child", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      fakeChildResult = {
        id: 456,
        message: "bar"
      },
      node = new j$.ResultsNode(fakeResult, "suite", null);

    node.addChild(fakeChildResult, "spec");

    expect(node.last()).toBe(node.children[node.children.length - 1]);
  });
});

Version data entries

57 entries across 57 versions & 4 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/bootstrap-tagsinput/lib/jasmine/spec/html/ResultsNodeSpec.js
tdiary-5.0.2 vendor/bundle/gems/jasmine-core-2.4.1/lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.1 vendor/bundle/gems/jasmine-core-2.4.1/lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.4.1 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.4.0 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
upjs-rails-0.11.0 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.10.5 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.10.4 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.10.3 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.10.2 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.10.1 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.10.0 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.9.1 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.9.0 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.8.2 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.8.1 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.8.0 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.7.8 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.7.7 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js
upjs-rails-0.7.6 spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js