refactor(search): simplify order by + wire reverse
This commit is contained in:
@@ -16,12 +16,12 @@ it('builds search requests including filters', async () => {
|
||||
fileTypes: ['mp3', 'wav'],
|
||||
minSize: 1,
|
||||
maxSize: 9,
|
||||
sortBy: 'date'
|
||||
sortBy: 'updated_at'
|
||||
}).catch(() => {});
|
||||
expect(j).toHaveBeenCalledWith(expect.stringContaining('type=mp3%2Cwav'), expect.anything());
|
||||
// Sort dimension is sent on the wire as `order_by`, matching the
|
||||
// backend's `SearchResourcesQuery` (post-normalization).
|
||||
expect(j).toHaveBeenCalledWith(expect.stringContaining('order_by=date'), expect.anything());
|
||||
expect(j).toHaveBeenCalledWith(expect.stringContaining('order_by=updated_at'), expect.anything());
|
||||
await searchSuggest('q').catch(() => {});
|
||||
await clearSearchCache().catch(() => {});
|
||||
expect(f.mock.calls.length + j.mock.calls.length).toBeGreaterThan(1);
|
||||
|
||||
Reference in New Issue
Block a user