File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ describe('Page', () => {
1111
1212 axiosMock . onAny ( ) . reply ( 200 , Buffer . from ( '' ) )
1313
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 ( ) => {
1519 await client . pdf . direct ( {
1620 page : {
1721 html : '<div>Your first Doczilla PDF</div>'
@@ -26,4 +30,19 @@ describe('Page', () => {
2630 } ) )
2731 } )
2832
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+
2948} )
You can’t perform that action at this time.
0 commit comments