From 8faa6db4c01185a11033a588614a24a9a4af283c Mon Sep 17 00:00:00 2001 From: grosbouddha Date: Wed, 16 Sep 2015 23:36:55 +0200 Subject: [PATCH] Fix SelectedColorsService tests --- test/js/service/SelectedColorsServiceTest.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/test/js/service/SelectedColorsServiceTest.js b/test/js/service/SelectedColorsServiceTest.js index cb6f5584..fdbd6d80 100644 --- a/test/js/service/SelectedColorsServiceTest.js +++ b/test/js/service/SelectedColorsServiceTest.js @@ -3,10 +3,8 @@ describe("SelectedColorsService test suite", function() { it("returns the default selected colors initially", function() { var service = new pskl.service.SelectedColorsService(); - var defaultSelectedColors = service.getColors(); - expect(defaultSelectedColors.length).toBe(2); - expect(defaultSelectedColors[0]).toBe(Constants.DEFAULT_PEN_COLOR); - expect(defaultSelectedColors[1]).toBe(Constants.TRANSPARENT_COLOR); + expect(service.getPrimaryColor()).toBe(Constants.DEFAULT_PEN_COLOR); + expect(service.getSecondaryColor()).toBe(Constants.TRANSPARENT_COLOR); }); it("reacts to PRIMARY_COLOR_SELECTED event", function() { @@ -16,10 +14,8 @@ describe("SelectedColorsService test suite", function() { var expectedColor = "#123456"; $.publish(Events.PRIMARY_COLOR_SELECTED, [expectedColor]); - var defaultSelectedColors = service.getColors(); - expect(defaultSelectedColors.length).toBe(2); - expect(defaultSelectedColors[0]).toBe(expectedColor); - expect(defaultSelectedColors[1]).toBe(Constants.TRANSPARENT_COLOR); + expect(service.getPrimaryColor()).toBe(expectedColor); + expect(service.getSecondaryColor()).toBe(Constants.TRANSPARENT_COLOR); }); it("reacts to SECONDARY_COLOR_SELECTED event", function() { @@ -29,9 +25,7 @@ describe("SelectedColorsService test suite", function() { var expectedColor = "#123456"; $.publish(Events.SECONDARY_COLOR_SELECTED, [expectedColor]); - var defaultSelectedColors = service.getColors(); - expect(defaultSelectedColors.length).toBe(2); - expect(defaultSelectedColors[0]).toBe(Constants.DEFAULT_PEN_COLOR); - expect(defaultSelectedColors[1]).toBe(expectedColor); + expect(service.getPrimaryColor()).toBe(Constants.DEFAULT_PEN_COLOR); + expect(service.getSecondaryColor()).toBe(expectedColor); }); }); \ No newline at end of file