[Timeline] Add more tests for rows

This commit is contained in:
Victor Woeltjen 2016-03-08 10:22:46 -08:00
parent 938c266b4e
commit fd92c5f970

View File

@ -54,19 +54,33 @@ define(
exporter = new TimelineCSVExporter(mockDomainObjects);
});
it("includes one row per domain object", function () {
var mockCallback = jasmine.createSpy('callback');
exporter.rows().then(mockCallback);
describe("rows", function () {
var rows;
beforeEach(function () {
exporter.rows().then(function (r) {
rows = r;
});
waitsFor(function () {
return mockCallback.calls.length > 0;
});
runs(function () {
expect(mockCallback.mostRecentCall.args[0].length)
.toEqual(mockDomainObjects.length);
return rows !== undefined;
});
});
it("include one row per domain object", function () {
expect(rows.length).toEqual(mockDomainObjects.length);
});
it("includes identifiers for each domain object", function () {
rows.forEach(function (row, index) {
var id = mockDomainObjects[index].getId();
expect(row.indexOf(id)).not.toEqual(-1);
});
});
});
});
}
);