Some checks failed
Node.js CI / build (push) Failing after 2s
Node.js CI / e2e-tests (+(a11y|security|bugs)/**/*cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/!(o|d|m)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/+(o|d)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/m*.cy.js) (push) Failing after 2s
CodeQL / Analyze (javascript) (push) Failing after 2m49s
Security scan for docker image / build (push) Failing after 51s
85 lines
2.5 KiB
JavaScript
Executable File
85 lines
2.5 KiB
JavaScript
Executable File
describe("Render Info Component", () => {
|
|
describe("OpenAPI 2.0", () => {
|
|
const baseUrl = "/?url=/documents/features/info-openAPI2.yaml"
|
|
|
|
it("should render Info Description", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info .description")
|
|
.should("contains.text", "This is a sample")
|
|
})
|
|
|
|
it("should render Info Main anchor target xss link with safe `rel` attributes", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info .main > a")
|
|
.should("have.attr", "rel")
|
|
.and("include", "noopener")
|
|
.and("include", "noreferrer")
|
|
.get(".info .main > a")
|
|
.should("have.attr", "target")
|
|
.and("equal", "_blank")
|
|
})
|
|
|
|
it("should not render Info Summary (an OpenAPI 3.1 field)", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info__summary")
|
|
.should("not.exist")
|
|
})
|
|
})
|
|
|
|
describe("OpenAPI 3.0.x", () => {
|
|
const baseUrl = "/?url=/documents/features/info-openAPI30.yaml"
|
|
|
|
it("should render Info Description", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info .description")
|
|
.should("contains.text", "This is a sample")
|
|
})
|
|
|
|
it("should render Info Main anchor target xss link with safe `rel` attributes", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info .main > a")
|
|
.should("have.attr", "rel")
|
|
.and("include", "noopener")
|
|
.and("include", "noreferrer")
|
|
.get(".info .main > a")
|
|
.should("have.attr", "target")
|
|
.and("equal", "_blank")
|
|
})
|
|
|
|
it("should not render Info Summary (an OpenAPI 3.1 field)", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info__summary")
|
|
.should("not.exist")
|
|
})
|
|
})
|
|
|
|
describe("OpenAPI 3.1.x", () => {
|
|
const baseUrl = "/?url=/documents/features/info-openAPI31.yaml"
|
|
|
|
it("should render Info Description", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info .description")
|
|
.should("contains.text", "This is a sample")
|
|
})
|
|
|
|
it("should render Info Main anchor target xss link with safe `rel` attributes", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info .main > a")
|
|
.should("have.attr", "rel")
|
|
.and("include", "noopener")
|
|
.and("include", "noreferrer")
|
|
.get(".info .main > a")
|
|
.should("have.attr", "target")
|
|
.and("equal", "_blank")
|
|
})
|
|
it("should render Info Summary", () => {
|
|
cy.visit(baseUrl)
|
|
.get(".info__summary")
|
|
.should("exist")
|
|
.should("contains.text", "new 3.1.x specific field")
|
|
.get(".info .description")
|
|
.should("contains.text", "This is a sample")
|
|
})
|
|
})
|
|
})
|