6276.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. describe("#6276: Query parameter filter=true is filtering by the value 'true'", () => {
  2. describe("With filter=true", () => {
  3. it("should display the filter bar", () => {
  4. cy.visit("/?url=/documents/petstore.swagger.yaml&filter=true")
  5. .get(".operation-filter-input")
  6. .should("exist")
  7. .should("be.empty")
  8. .get(".opblock-tag[data-tag='pet']")
  9. .should("exist")
  10. .get(".opblock-tag[data-tag='store']")
  11. .should("exist")
  12. .get(".opblock-tag[data-tag='user']")
  13. .should("exist")
  14. })
  15. })
  16. describe("With filter=false", () => {
  17. it("should not display the filter bar", () => {
  18. cy.visit("/?url=/documents/petstore.swagger.yaml&filter=false")
  19. .get(".operation-filter-input")
  20. .should("not.exist")
  21. .get(".opblock-tag[data-tag='pet']")
  22. .should("exist")
  23. .get(".opblock-tag[data-tag='store']")
  24. .should("exist")
  25. .get(".opblock-tag[data-tag='user']")
  26. .should("exist")
  27. })
  28. })
  29. describe("With filter=pet", () => {
  30. it("should display the filter bar and only show the operations tagged with pet", () => {
  31. cy.visit("/?url=/documents/petstore.swagger.yaml&filter=pet")
  32. .get(".operation-filter-input")
  33. .should("exist")
  34. .should("have.value", "pet")
  35. .get(".opblock-tag[data-tag='pet']")
  36. .should("exist")
  37. .get(".opblock-tag[data-tag='store']")
  38. .should("not.exist")
  39. .get(".opblock-tag[data-tag='user']")
  40. .should("not.exist")
  41. })
  42. })
  43. })