Skip to content

Commit 04c774e

Browse files
committed
Auto merge of #4381 - Turbo87:search-qps, r=Turbo87
tests/search: Add test case for query parameter forwarding This should ensure to not break the functionality that was added in #1543 when working on implementing #491.
2 parents c171eb3 + 3ada934 commit 04c774e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/acceptance/search-test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)