We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d0c993 commit 327dfd1Copy full SHA for 327dfd1
1 file changed
src/__tests__/page.spec.ts
@@ -11,7 +11,7 @@ describe('Page', () => {
11
12
axiosMock.onAny().reply(200, Buffer.from(''))
13
14
- test('it encode the page.html option', async () => {
+ test('it encode the page.html option (pdf)', async () => {
15
await client.pdf.direct({
16
page: {
17
html: '<div>Your first Doczilla PDF</div>'
@@ -26,4 +26,19 @@ describe('Page', () => {
26
}))
27
})
28
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
39
+ html: 'PGRpdj5Zb3VyIGZpcnN0IERvY3ppbGxhIFBERjwvZGl2Pg=='
40
41
+ }))
42
43
44
0 commit comments