From fd92c5f97088868dd277dfbb3f75db9674823bd0 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 8 Mar 2016 10:22:46 -0800 Subject: [PATCH] [Timeline] Add more tests for rows --- .../test/actions/TimelineCSVExporterSpec.js | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js b/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js index 0fb602e2ce..cbe382c988 100644 --- a/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js +++ b/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js @@ -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); - waitsFor(function () { - return mockCallback.calls.length > 0; + describe("rows", function () { + var rows; + + beforeEach(function () { + 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); + }); }); }); + }); } ); \ No newline at end of file