feat: add tryItOutEnabled configuration (#6865)
* feat: add tryItOutEnabled configuration allow users to set tryItOutEnabled: true to display the "Try it out" section by default tryItOutEnabled to take === "true" for the query string value or === true if someone implements query string type parsing in the query
This commit is contained in:
22
test/e2e-cypress/tests/features/try-it-out-enabled.js
Normal file
22
test/e2e-cypress/tests/features/try-it-out-enabled.js
Normal file
@@ -0,0 +1,22 @@
|
||||
describe("Try it out enabled configuration", () => {
|
||||
it("should enable the try it out section when true", () => {
|
||||
|
||||
cy
|
||||
.visit("?tryItOutEnabled=true&url=/documents/features/try-it-out-enabled.yaml")
|
||||
.get("#operations-default-get_")
|
||||
.click()
|
||||
.get(".try-out__btn")
|
||||
.should("have.text","Cancel")
|
||||
})
|
||||
|
||||
it("should disable the try it out section when false", () => {
|
||||
|
||||
cy
|
||||
.visit("?tryItOutEnabled=false&url=/documents/features/try-it-out-enabled.yaml")
|
||||
.get("#operations-default-get_")
|
||||
.click()
|
||||
.get(".try-out__btn")
|
||||
.should("have.text","Try it out ")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user