mirror of
https://github.com/nasa/openmct.git
synced 2024-12-29 01:18:52 +00:00
e953e5b4b4
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.
37 lines
1.0 KiB
JavaScript
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");
|
|
});
|
|
|
|
});
|
|
}
|
|
); |