[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); exporter = new TimelineCSVExporter(mockDomainObjects);
}); });
it("includes one row per domain object", function () { describe("rows", function () {
var mockCallback = jasmine.createSpy('callback'); var rows;
exporter.rows().then(mockCallback);
waitsFor(function () { beforeEach(function () {
return mockCallback.calls.length > 0; exporter.rows().then(function (r) {
rows = r;
});
waitsFor(function () {
return rows !== undefined;
});
}); });
runs(function () {
expect(mockCallback.mostRecentCall.args[0].length)
.toEqual(mockDomainObjects.length); 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);
});
}); });
}); });
}); });
} }
); );