starting canvas module
This commit is contained in:
parent
7ccbdac37b
commit
e6d46b593b
5 changed files with 67 additions and 2 deletions
32
test/view/canvas.test.js
Normal file
32
test/view/canvas.test.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
let assert = require('assert')
|
||||
let Canvas = require('../../app/view/canvas')
|
||||
|
||||
describe('Canvas', function () {
|
||||
|
||||
it('should draw only Image objects', function () {
|
||||
let canvas = new Canvas()
|
||||
let image = new window.Image()
|
||||
|
||||
assert.throws(canvas.draw, 'Invalid image')
|
||||
assert.throws(canvas.draw.bind(canvas, image, true), 'Invalid image')
|
||||
assert.doesNotThrow(canvas.draw.bind(canvas, image, true, image), 'Invalid image')
|
||||
})
|
||||
|
||||
it('should draw a single page')
|
||||
|
||||
it('should draw a double page')
|
||||
|
||||
it('should draw a manga double page')
|
||||
|
||||
it('should draw a single double page spread')
|
||||
|
||||
it('should show a blank last page if the last double page only has one image')
|
||||
|
||||
it('should auto-fit to window width')
|
||||
|
||||
it('should auto-fit to window height')
|
||||
|
||||
it('should manual zoom')
|
||||
|
||||
it('should always center pages')
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue