File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,19 @@ beforeEach(() => {
77 fetch . mockResponse ( JSON . stringify ( { } ) )
88} )
99
10+ const http = clientConstructor ( {
11+ token : '123'
12+ } )
13+
14+ const responsesRequest = responses ( http )
15+
1016test ( 'List responses has the correct path and method' , ( ) => {
11- const http = clientConstructor ( {
12- token : '123'
13- } )
14- const responsesRequest = responses ( http )
1517 responsesRequest . list ( { uid : 2 } )
1618 expect ( fetch . mock . calls [ 0 ] [ 1 ] . method ) . toBe ( 'get' )
1719 expect ( fetch . mock . calls [ 0 ] [ 0 ] ) . toBe ( `${ API_BASE_URL } /forms/2/responses` )
1820} )
1921
2022test ( 'List responses with the given filters' , ( ) => {
21- const http = clientConstructor ( {
22- token : '123' ,
23- } )
24- const responsesRequest = responses ( http )
2523 responsesRequest . list ( { uid : 2 , pageSize : 15 , after : '12345' } )
2624 const params = ( new URL ( fetch . mock . calls [ 0 ] [ 0 ] ) ) . searchParams
2725 expect ( params . get ( 'page_size' ) ) . toBe ( '15' )
You can’t perform that action at this time.
0 commit comments