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

Conversation

yannickcr
Copy link
Contributor

@yannickcr yannickcr commented Aug 23, 2019

Add a spec for initializing the state from the route.

Will test the following scenario:

  1. It navigates to the e-commerce demo with refinements set in route
  2. It must have "mixer" set as initial search box value
  3. It must have "Appliances" and "Small Kitchen Appliances" items selected in the category menu
  4. It must have "KitchenAid" brand selected in the brands menu
  5. It must have lower price set to $50 and the upper price set to $350 in the price range
  6. It must have free shipping box checked
  7. It must have rating "4 & up" selected in the rating menu
  8. It must have "Price descending" selected in the sort select
  9. It must have "32 hits per page" selected in the hits per page select
  10. It must have page 2 selected in the pagination
  11. It must have the expected results
  12. It sets "cooktop" as search box value
  13. It deselects "KitchenAid" brand in the brands menu
  14. It deselects "Small Kitchen Appliances" items and select "Ranges, Cooktops & Ovens" in the category menu
  15. It selects "Whirlpool" brand in the brands menu
  16. It unchecks free shipping box
  17. It selects rating "3 & up" in the rating menu
  18. It selects "Price ascending" in the sort select
  19. It sets lower price to $250 and the upper price to $1250 in the price range
  20. It selects "64 hits per page" in the hits per page select
  21. It selects page 2 in the pagination
  22. It must have the expected url

Copy link

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

specs/initial-state-from-route.spec.ts Outdated Show resolved Hide resolved
Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we adding another test suite for writing in the router or should we address these cases in here?

@yannickcr
Copy link
Contributor Author

What do you mean by writing in the router? Making changes in the refinements and check if they are correctly passed in the URL?

@Haroenv
Copy link

Haroenv commented Aug 28, 2019

That's how I interpret it as well @yannickcr, making some changes, and checking if the URL is correct

@yannickcr
Copy link
Contributor Author

Ok, in that case I think it can be added to this test.

@francoischalifour
Copy link
Member

We only test one part of the routing here. We're checking that:

  • The URL is translated into the correct UI state
  • The UI state is translated into the correct URL

Copy link

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@yannickcr yannickcr merged commit f92238e into master Sep 6, 2019
@yannickcr yannickcr deleted the feat/state-route branch September 6, 2019 12:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants