Skip to content

Commit 327dfd1

Browse files
committed
test: Added specific test for screenshots
1 parent 8d0c993 commit 327dfd1

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/__tests__/page.spec.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('Page', () => {
1111

1212
axiosMock.onAny().reply(200, Buffer.from(''))
1313

14-
test('it encode the page.html option', async () => {
14+
test('it encode the page.html option (pdf)', async () => {
1515
await client.pdf.direct({
1616
page: {
1717
html: '<div>Your first Doczilla PDF</div>'
@@ -26,4 +26,19 @@ describe('Page', () => {
2626
}))
2727
})
2828

29+
test('it encode the page.html option (screenshot)', async () => {
30+
await client.screenshot.direct({
31+
page: {
32+
html: '<div>Your first Doczilla PDF</div>'
33+
}
34+
})
35+
36+
expect(axiosMock.history.post.length).toBe(1)
37+
expect(axiosMock.history.post[0].data).toEqual(JSON.stringify({
38+
page: {
39+
html: 'PGRpdj5Zb3VyIGZpcnN0IERvY3ppbGxhIFBERjwvZGl2Pg=='
40+
}
41+
}))
42+
})
43+
2944
})

0 commit comments

Comments
 (0)