mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 23:36:41 +00:00
[Timeline] Add more tests for rows
This commit is contained in:
parent
938c266b4e
commit
fd92c5f970
@ -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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
Loading…
Reference in New Issue
Block a user