mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Merge pull request #309 from juliandescottes/dithering-tests
Dithering tests
This commit is contained in:
commit
d17f235aee
@ -13,5 +13,6 @@
|
||||
"selection.rectangular.json",
|
||||
"squares.circles.json",
|
||||
"stroke.json",
|
||||
"verticalpen.drawing.json"
|
||||
"verticalpen.drawing.json",
|
||||
"dithering.basic.json"
|
||||
]}
|
@ -11,5 +11,6 @@
|
||||
"selection.rectangular.json",
|
||||
"squares.circles.json",
|
||||
"stroke.json",
|
||||
"verticalpen.drawing.json"
|
||||
"verticalpen.drawing.json",
|
||||
"dithering.basic.json"
|
||||
];
|
1
test/drawing/tests/dithering.basic.json
Normal file
1
test/drawing/tests/dithering.basic.json
Normal file
File diff suppressed because one or more lines are too long
37
test/js/service/SelectedColorsServiceTest.js
Normal file
37
test/js/service/SelectedColorsServiceTest.js
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
it("reacts to PRIMARY_COLOR_SELECTED event", function() {
|
||||
var service = new pskl.service.SelectedColorsService();
|
||||
service.init();
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
it("reacts to SECONDARY_COLOR_SELECTED event", function() {
|
||||
var service = new pskl.service.SelectedColorsService();
|
||||
service.init();
|
||||
|
||||
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);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user