Files
swagger-ui/test/e2e-cypress/e2e/bugs/6276.cy.js
Vladimír Gorej 3e81a4f897 chore(deps-dev): update cypress to v12 (#8889)
This update required changing the configuration
and test directory structure. Some tests needed
to be amended as well to compensate for new
Cypress APIs.
2023-06-07 10:25:32 +02:00

44 lines
1.5 KiB
JavaScript

describe("#6276: Query parameter filter=true is filtering by the value 'true'", () => {
describe("With filter=true", () => {
it("should display the filter bar", () => {
cy.visit("/?url=/documents/petstore.swagger.yaml&filter=true")
.get(".operation-filter-input")
.should("exist")
.should("be.empty")
.get(".opblock-tag[data-tag='pet']")
.should("exist")
.get(".opblock-tag[data-tag='store']")
.should("exist")
.get(".opblock-tag[data-tag='user']")
.should("exist")
})
})
describe("With filter=false", () => {
it("should not display the filter bar", () => {
cy.visit("/?url=/documents/petstore.swagger.yaml&filter=false")
.get(".operation-filter-input")
.should("not.exist")
.get(".opblock-tag[data-tag='pet']")
.should("exist")
.get(".opblock-tag[data-tag='store']")
.should("exist")
.get(".opblock-tag[data-tag='user']")
.should("exist")
})
})
describe("With filter=pet", () => {
it("should display the filter bar and only show the operations tagged with pet", () => {
cy.visit("/?url=/documents/petstore.swagger.yaml&filter=pet")
.get(".operation-filter-input")
.should("exist")
.should("have.value", "pet")
.get(".opblock-tag[data-tag='pet']")
.should("exist")
.get(".opblock-tag[data-tag='store']")
.should("not.exist")
.get(".opblock-tag[data-tag='user']")
.should("not.exist")
})
})
})