2014-12-02 23:25:23 +00:00
|
|
|
/*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 () {
|
2014-12-02 23:59:09 +00:00
|
|
|
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");
|
|
|
|
});
|
|
|
|
|
2014-12-02 23:25:23 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|