Guest User

Untitled

a guest
Jan 24th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. describe('consumer step two', function() {
  2.  
  3. describe('cuisine facet', function() {
  4.  
  5. afterEach(function() {
  6. vendorsJs.cuisineFacetExpanded = false;
  7. });
  8.  
  9. describe('when less than 10 cuisine types', function() {
  10.  
  11. beforeEach(function() {
  12. loadFixtures('step_two_less_than_ten_cuisines_fixture.html');
  13. vendorsJs.collapseCuisineFilters();
  14. });
  15.  
  16. it('should not show more or less link on initial load', function() {
  17. expect($('#CuisineFacet a.more').length).toBe(0);
  18. expect($('#CuisineFacet a.less').length).toBe(0);
  19. });
  20.  
  21. });
  22.  
  23. describe('when more than 10 cuisine types', function() {
  24.  
  25. beforeEach(function() {
  26. loadFixtures('step_two_more_than_ten_cuisines_fixture.html');
  27. vendorsJs.collapseCuisineFilters();
  28. });
  29.  
  30. it('should collapse to 10 on initial load', function() {
  31. expect($('#CuisineFacet li:visible').length).toBe(10);
  32. expect(vendorsJs.cuisineFacetExpanded).toBeFalsy();
  33. });
  34.  
  35. it('should show more link on initial load if more than than 10 cuisines types', function() {
  36. expect($('#CuisineFacet a.more')).toBeVisible();
  37. expect($('#CuisineFacet a.less').length).toBe(0);
  38. });
  39.  
  40. it('should remain open once user clicks more', function() {
  41. $('.more').click();
  42. expect(vendorsJs.cuisineFacetExpanded).toBeTruthy();
  43. });
  44.  
  45. });
  46.  
  47. });
  48. });
Add Comment
Please, Sign In to add comment