[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.
This commit is contained in:
Victor Woeltjen
2014-12-02 15:59:09 -08:00
parent c0a34149ca
commit e953e5b4b4
6 changed files with 293 additions and 98 deletions

View File

@ -9,6 +9,29 @@ define(
"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");
});
});
}
);