openmct/platform/features/scrolling/test/NameColumnSpec.js
Victor Woeltjen e953e5b4b4 [Scrolling] Fill in specs
Fill in specs for ScrollingListController, and for
the specific Column types that support it. Separate
out the code that produces actual rows in order to
improve testability and maintainability. WTD-534.
2014-12-02 15:59:09 -08:00

37 lines
1.0 KiB
JavaScript

/*global define,describe,it,expect,beforeEach,waitsFor,jasmine*/
/**
* MergeModelsSpec. Created by vwoeltje on 11/6/14.
*/
define(
["../src/NameColumn"],
function (NameColumn) {
"use strict";
describe("A name column", function () {
var mockDomainObject,
column;
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getModel" ]
);
mockDomainObject.getModel.andReturn({
name: "Test object name"
});
column = new NameColumn();
});
it("reports a column header", function () {
expect(column.getTitle()).toEqual("Name");
});
it("looks up name from an object's model", function () {
expect(column.getValue(mockDomainObject))
.toEqual("Test object name");
});
});
}
);