X-Git-Url: https://pwan.org/git/?p=tech-radar.git;a=blobdiff_plain;f=test%2Fmodels%2Fradar-spec.js;h=2c4d883d371f30bd00f45956d67f81d658926872;hp=09043d68d1a216f5d4cebc5b4ee059d2dc8ee96e;hb=abf96ef7f9d407aa7040be4bd32239793ef93c3d;hpb=646ed3c7a26852dcbf9f48c744c0128e1129fdc2 diff --git a/test/models/radar-spec.js b/test/models/radar-spec.js index 09043d6..2c4d883 100644 --- a/test/models/radar-spec.js +++ b/test/models/radar-spec.js @@ -53,6 +53,40 @@ describe('tr.models.Radar', function () { expect(radar.quadrants().IV).toEqual(quadrant); }); + describe('blip numbers', function () { + var firstQuadrant, secondQuadrant, radar, firstCycle; + + beforeEach(function () { + firstCycle = new tr.models.Cycle('Adopt', 0); + firstQuadrant = new tr.models.Quadrant('First'); + secondQuadrant = new tr.models.Quadrant('Second'); + firstQuadrant.add([ + new tr.models.Blip('A', firstCycle), + new tr.models.Blip('B', firstCycle) + ]); + secondQuadrant.add([ + new tr.models.Blip('C', firstCycle), + new tr.models.Blip('D', firstCycle) + ]); + radar = new tr.models.Radar(); + }); + + it('sets blip numbers starting on the first quadrant', function () { + radar.setFirstQuadrant(firstQuadrant); + + expect(radar.quadrants().I.blips()[0].number()).toEqual(1); + expect(radar.quadrants().I.blips()[1].number()).toEqual(2); + }); + + it('continues the number from the previous quadrant set', function () { + radar.setFirstQuadrant(firstQuadrant); + radar.setSecondQuadrant(secondQuadrant); + + expect(radar.quadrants().II.blips()[0].number()).toEqual(3); + expect(radar.quadrants().II.blips()[1].number()).toEqual(4); + }); + }); + describe('cycles', function () { var quadrant, radar, firstCycle, secondCycle;