@@ -194,6 +194,21 @@ describe('url param generation', () => {
194194 'screenshots[everything]' : 'fullpage' ,
195195 } ) ;
196196 } ) ;
197+ it ( 'screenshot flags converted to params' , ( ) => {
198+ const config = new ScrapeConfig ( {
199+ url : 'http://httpbin.dev/get' ,
200+ screenshots : { everything : 'fullpage' } ,
201+ screenshot_flags : "load_images,dark_mode,block_banners,high_quality,print_media_format" ,
202+ render_js : true ,
203+ } ) ;
204+ expect ( config . toApiParams ( { key : '1234' } ) ) . toEqual ( {
205+ key : '1234' ,
206+ url : 'http://httpbin.dev/get' ,
207+ 'screenshots[everything]' : 'fullpage' ,
208+ screenshot_flags : "load_images,dark_mode,block_banners,high_quality,print_media_format" ,
209+ render_js : true ,
210+ } ) ;
211+ } ) ;
197212 it ( 'asp enables' , ( ) => {
198213 const config = new ScrapeConfig ( {
199214 url : 'http://httpbin.dev/get' ,
@@ -238,6 +253,17 @@ describe('url param generation', () => {
238253 tags : 'foo,bar,gaz' ,
239254 } ) ;
240255 } ) ;
256+ it ( 'format set' , ( ) => {
257+ const config = new ScrapeConfig ( {
258+ url : 'http://httpbin.dev/get' ,
259+ format : "markdown" ,
260+ } ) ;
261+ expect ( config . toApiParams ( { key : '1234' } ) ) . toEqual ( {
262+ key : '1234' ,
263+ url : 'http://httpbin.dev/get' ,
264+ format : "markdown" ,
265+ } ) ;
266+ } ) ;
241267 it ( 'debug sets' , ( ) => {
242268 const config = new ScrapeConfig ( {
243269 url : 'http://httpbin.dev/get' ,
0 commit comments