Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

feat(spec): add spec for initializing the state from the route #4

Merged
merged 5 commits into from
Sep 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion specs/initial-state-from-route.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
import { URLSearchParams } from 'url';

describe('InstantSearch - Initialize state from the route', () => {
it('navigates to the e-commerce demo with refinements set in route', async () => {
const params = new URLSearchParams({
Haroenv marked this conversation as resolved.
Show resolved Hide resolved
query: 'mixer',
page: '2',
brands: 'KitchenAid',
rating: '4',
price: '50:350',
free_shipping: 'true', // eslint-disable-line @typescript-eslint/camelcase
sortBy: 'instant_search_price_desc',
hitsPerPage: '32',
});
await browser.url(
'examples/e-commerce/search/Appliances%2FSmall+Kitchen+Appliances/?query=mixer&page=2&brands=KitchenAid&rating=4&price=50%3A350&free_shipping=true&sortBy=instant_search_price_desc&hitsPerPage=32'
`examples/e-commerce/search/Appliances%2FSmall+Kitchen+Appliances/?${params.toString()}`
);
});

Expand Down