Skip to content

Commit 7ebe972

Browse files
committed
bosanowa: Add unit tests for display modes
1 parent 7ae9da4 commit 7ebe972

2 files changed

Lines changed: 19 additions & 21 deletions

File tree

src/variety/bosanowa.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -309,27 +309,6 @@
309309
return this.getBoardRows() + 2 * this.margin + (disptype === 2 ? 2 : 0);
310310
},
311311

312-
drawErrorCells_bosanowa: function() {
313-
var g = this.vinc("cell_back", "crispEdges", true);
314-
315-
g.fillStyle = this.errbcolor1;
316-
var clist = this.range.cells;
317-
for (var i = 0; i < clist.length; i++) {
318-
var cell = clist[i];
319-
g.vid = "c_fullerr_" + cell.id;
320-
if (cell.error === 1) {
321-
g.fillRectCenter(
322-
cell.bx * this.bw,
323-
cell.by * this.bh,
324-
this.bw,
325-
this.bh
326-
);
327-
} else {
328-
g.vhide();
329-
}
330-
}
331-
},
332-
333312
getCircleStrokeColor: function(cell) {
334313
if (cell.isValid() && !cell.isNum()) {
335314
return cell.error === 1 ? this.errcolor1 : this.quescolor;

test/variety/bosanowa_test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// test/variety/bosanowa_test.js
2+
3+
var assert = require("assert");
4+
5+
var pzpr = require("../../");
6+
7+
var puzzle = new pzpr.Puzzle();
8+
9+
describe("Variety:bosanowa", function() {
10+
it("loads styles", function() {
11+
puzzle.open("bosanowa/h/6/5/jo9037g2n2n3g4j3i");
12+
puzzle.toBuffer("svg", 0, 30);
13+
assert.equal(puzzle.getConfig("disptype_bosanowa"), 2);
14+
15+
puzzle.open("bosanowa/t/6/5/jo9037g2n2n3g4j3i");
16+
puzzle.toBuffer("svg", 0, 30);
17+
assert.equal(puzzle.getConfig("disptype_bosanowa"), 3);
18+
});
19+
});

0 commit comments

Comments
 (0)