File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ describe('Page', () => {
11
11
12
12
axiosMock . onAny ( ) . reply ( 200 , Buffer . from ( '' ) )
13
13
14
- test ( 'it encode the page.html option' , async ( ) => {
14
+ beforeEach ( ( ) => {
15
+ axiosMock . resetHistory ( )
16
+ } )
17
+
18
+ test ( 'it encode the page.html option (pdf)' , async ( ) => {
15
19
await client . pdf . direct ( {
16
20
page : {
17
21
html : '<div>Your first Doczilla PDF</div>'
@@ -26,4 +30,19 @@ describe('Page', () => {
26
30
} ) )
27
31
} )
28
32
33
+ test ( 'it encode the page.html option (screenshot)' , async ( ) => {
34
+ await client . screenshot . direct ( {
35
+ page : {
36
+ html : '<div>Your first Doczilla PDF</div>'
37
+ }
38
+ } )
39
+
40
+ expect ( axiosMock . history . post . length ) . toBe ( 1 )
41
+ expect ( axiosMock . history . post [ 0 ] . data ) . toEqual ( JSON . stringify ( {
42
+ page : {
43
+ html : 'PGRpdj5Zb3VyIGZpcnN0IERvY3ppbGxhIFBERjwvZGl2Pg=='
44
+ }
45
+ } ) )
46
+ } )
47
+
29
48
} )
You can’t perform that action at this time.
0 commit comments