File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -172,4 +172,23 @@ module('Acceptance | search', function (hooks) {
172172 await settled ( ) ;
173173 assert . dom ( '[data-test-crate-row]' ) . exists ( { count : 1 } ) ;
174174 } ) ;
175+
176+ test ( 'passes query parameters to the backend' , async function ( assert ) {
177+ this . server . get ( '/api/v1/crates' , function ( schema , request ) {
178+ assert . step ( '/api/v1/crates' ) ;
179+
180+ assert . deepEqual ( request . queryParams , {
181+ all_keywords : 'fire ball' ,
182+ page : '3' ,
183+ per_page : '15' ,
184+ q : 'rust' ,
185+ sort : 'new' ,
186+ } ) ;
187+
188+ return { crates : [ ] , meta : { total : 0 } } ;
189+ } ) ;
190+
191+ await visit ( '/search?q=rust&page=3&per_page=15&sort=new&all_keywords=fire ball' ) ;
192+ assert . verifySteps ( [ '/api/v1/crates' ] ) ;
193+ } ) ;
175194} ) ;
You can’t perform that action at this time.
0 commit comments