diff --git a/platform/features/timeline/test/actions/CompositionColumnSpec.js b/platform/features/timeline/test/actions/CompositionColumnSpec.js index 8cf566a080..df52d08db5 100644 --- a/platform/features/timeline/test/actions/CompositionColumnSpec.js +++ b/platform/features/timeline/test/actions/CompositionColumnSpec.js @@ -23,13 +23,20 @@ define( ['../../src/actions/CompositionColumn'], function (CompositionColumn) { + var TEST_IDS = ['a', 'b', 'c', 'd', 'e', 'f']; + describe("CompositionColumn", function () { var testIndex, + testIdMap, column; beforeEach(function () { testIndex = 3; - column = new CompositionColumn(testIndex); + testIdMap = TEST_IDS.reduce(function (map, id, index) { + map[id] = index; + return map; + }, {}); + column = new CompositionColumn(testIndex, testIdMap); }); it("includes a one-based index in its name", function () { @@ -46,15 +53,13 @@ define( 'domainObject', ['getId', 'getModel', 'getCapability'] ); - testModel = { - composition: ['a', 'b', 'c', 'd', 'e', 'f'] - }; + testModel = { composition: TEST_IDS }; mockDomainObject.getModel.andReturn(testModel); }); - it("returns a corresponding identifier", function () { + it("returns a corresponding value from the map", function () { expect(column.value(mockDomainObject)) - .toEqual(testModel.composition[testIndex]); + .toEqual(testIdMap[testModel.composition[testIndex]]); }); it("returns nothing when composition is exceeded", function () { diff --git a/platform/features/timeline/test/actions/IdColumnSpec.js b/platform/features/timeline/test/actions/IdColumnSpec.js index f44d255255..80b84680a4 100644 --- a/platform/features/timeline/test/actions/IdColumnSpec.js +++ b/platform/features/timeline/test/actions/IdColumnSpec.js @@ -24,10 +24,12 @@ define( ['../../src/actions/IdColumn'], function (IdColumn) { describe("IdColumn", function () { - var column; + var testIdMap, + column; beforeEach(function () { - column = new IdColumn(); + testIdMap = { "foo": "bar" }; + column = new IdColumn(testIdMap); }); it("has a name", function () { @@ -47,9 +49,9 @@ define( mockDomainObject.getId.andReturn(testId); }); - it("provides a domain object's identifier", function () { + it("provides a value mapped from domain object's identifier", function () { expect(column.value(mockDomainObject)) - .toEqual(testId); + .toEqual(testIdMap[testId]); }); }); diff --git a/platform/features/timeline/test/actions/ModeColumnSpec.js b/platform/features/timeline/test/actions/ModeColumnSpec.js index 446e3b1030..b828511266 100644 --- a/platform/features/timeline/test/actions/ModeColumnSpec.js +++ b/platform/features/timeline/test/actions/ModeColumnSpec.js @@ -23,13 +23,20 @@ define( ['../../src/actions/ModeColumn'], function (ModeColumn) { + var TEST_IDS = ['a', 'b', 'c', 'd', 'e', 'f'] + describe("ModeColumn", function () { var testIndex, + testIdMap, column; beforeEach(function () { testIndex = 3; - column = new ModeColumn(testIndex); + testIdMap = TEST_IDS.reduce(function (map, id, index) { + map[id] = index; + return map; + }, {}); + column = new ModeColumn(testIndex, testIdMap); }); it("includes a one-based index in its name", function () { @@ -48,15 +55,15 @@ define( ); testModel = { relationships: { - modes: ['a', 'b', 'c', 'd', 'e', 'f'] + modes: TEST_IDS } }; mockDomainObject.getModel.andReturn(testModel); }); - it("returns a corresponding identifier", function () { + it("returns a corresponding value from the map", function () { expect(column.value(mockDomainObject)) - .toEqual(testModel.relationships.modes[testIndex]); + .toEqual(testIdMap[testModel.relationships.modes[testIndex]]); }); it("returns nothing when relationships are exceeded", function () { diff --git a/platform/features/timeline/test/actions/TimelineColumnizerSpec.js b/platform/features/timeline/test/actions/TimelineColumnizerSpec.js index 3c9b3de7e6..980ed1e6c3 100644 --- a/platform/features/timeline/test/actions/TimelineColumnizerSpec.js +++ b/platform/features/timeline/test/actions/TimelineColumnizerSpec.js @@ -94,13 +94,6 @@ define( 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); - }); - }); }); describe("headers", function () {