File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,24 @@ const http = clientConstructor({
1212} )
1313const workspacesRequest = workspaces ( http )
1414
15-
1615test ( `Get workspaces has the correct path` , ( ) => {
1716 workspacesRequest . list ( )
1817 expect ( fetch . mock . calls [ 0 ] [ 0 ] ) . toBe ( `${ API_BASE_URL } /workspaces` )
1918} )
2019
20+ test ( `Get workspaces has the correct query parameters` , ( ) => {
21+ workspacesRequest . list ( {
22+ search : 'hola' ,
23+ page : 2 ,
24+ pageSize : 10
25+ } )
26+
27+ const params = new URL ( fetch . mock . calls [ 0 ] [ 0 ] ) . searchParams
28+ expect ( params . get ( 'search' ) ) . toBe ( 'hola' )
29+ expect ( params . get ( 'page' ) ) . toBe ( '2' )
30+ expect ( params . get ( 'page_size' ) ) . toBe ( '10' )
31+ } )
32+
2133test ( `Get specific workscape has the correct path and method` , ( ) => {
2234 workspacesRequest . get ( { id : 2 } )
2335 expect ( fetch . mock . calls [ 0 ] [ 1 ] . method ) . toBe ( `get` )
You can’t perform that action at this time.
0 commit comments