forked from parallax/jsPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay-mode.spec.js
More file actions
58 lines (52 loc) · 1.61 KB
/
Copy pathdisplay-mode.spec.js
File metadata and controls
58 lines (52 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'use strict'
/* global describe, it, jsPDF, comparePdf, jasmine, expect */
/**
* Standard spec tests
*
* These tests return the datauristring so that reference files can be generated.
* We compare the exact output.
*/
describe('jsPDF init display modes', () => {
it('should set zoom mode to fullheight', () => {
const doc = jsPDF()
doc.setDisplayMode('fullheight')
doc.text(10, 10, 'This is a test')
doc.output()
comparePdf(doc.output(), 'zoom-full-height.pdf', 'init')
})
it('should set zoom mode to fullpage', () => {
const doc = jsPDF('landscape')
doc.setDisplayMode('fullpage')
doc.text(10, 10, 'This is a test')
doc.output()
comparePdf(doc.output(), 'zoom-full-page.pdf', 'init')
})
it('should set zoom mode to original', () => {
const doc = jsPDF('landscape')
doc.setDisplayMode('original')
doc.text(10, 10, 'This is a test')
doc.output()
comparePdf(doc.output(), 'zoom-original.pdf', 'init')
})
it('should set zoom mode to 2x', () => {
const doc = jsPDF('landscape')
doc.setDisplayMode(2)
doc.text(20, 20, 'This is a test')
doc.output()
comparePdf(doc.output(), 'zoom-2x.pdf', 'init')
})
it('should set zoom mode to 3x', () => {
const doc = jsPDF('landscape')
doc.setDisplayMode(3)
doc.text(20, 20, 'This is a test')
doc.output()
comparePdf(doc.output(), 'zoom-3x.pdf', 'init')
})
it('should set zoom mode to 3x', () => {
const doc = jsPDF('landscape')
doc.setDisplayMode('300%')
doc.text(20, 20, 'This is a test')
doc.output()
comparePdf(doc.output(), 'zoom-3x.pdf', 'init')
})
})