From 9e6e33983b7f4a9017387519298553d3b80f46c1 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 8 Mar 2016 10:17:10 -0800 Subject: [PATCH] [Timeline] Add more objects to test case --- .../test/actions/TimelineCSVExporterSpec.js | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js b/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js index c07eb29756..0fb602e2ce 100644 --- a/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js +++ b/platform/features/timeline/test/actions/TimelineCSVExporterSpec.js @@ -28,8 +28,29 @@ define( var mockDomainObjects, exporter; + function makeMockDomainObject(model, index) { + var mockDomainObject = jasmine.createSpyObj( + 'domainObject-' + index, + [ + 'getId', + 'getCapability', + 'useCapability', + 'hasCapability', + 'getModel' + ] + ); + mockDomainObject.getId.andReturn('id-' + index); + mockDomainObject.getModel.andReturn(model); + return mockDomainObject; + } + beforeEach(function () { - mockDomainObjects = []; + mockDomainObjects = [ + { composition: [ 'a', 'b', 'c' ] }, + { relationships: { modes: [ 'x', 'y' ] } }, + { } + ].map(makeMockDomainObject); + exporter = new TimelineCSVExporter(mockDomainObjects); });