feat(oas31): add support for OpenAPI 3.1.0 badge (#8502)

Refs #8501
This commit is contained in:
Vladimír Gorej
2023-03-23 10:13:20 +01:00
committed by GitHub
parent 1333d4dd2e
commit 16224263d1
6 changed files with 69 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ describe("#4865: multiple invocations + OAS3 plugin", () => {
cy.visit("/?url=/documents/petstore-expanded.openapi.yaml")
.get("#swagger-ui")
.get("pre.version")
.contains("OAS3")
.contains("OAS 3.0")
})
it("test: should render the OAS3 badge correctly after re-initializing the UI", () => {
@@ -14,6 +14,6 @@ describe("#4865: multiple invocations + OAS3 plugin", () => {
.then(win => win.onload()) // re-initializes Swagger UI
.get("#swagger-ui")
.get("pre.version")
.contains("OAS3")
.contains("OAS 3.0")
})
})

View File

@@ -0,0 +1,15 @@
describe("OpenAPI 3.x.y Badge", () => {
it("should display light green badge with version indicator for OpenAPI 3.0.x", () => {
cy.visit("/?url=/documents/petstore-expanded.openapi.yaml")
.get("#swagger-ui")
.get("pre.version")
.contains("OAS 3.0")
})
it("should display light green badge with version indicator for OpenAPI 3.1.0", () => {
cy.visit("/?url=/documents/features/info-openAPI31.yaml")
.get("#swagger-ui")
.get("pre.version")
.contains("OAS 3.1")
})
})