Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
openapi: "3.0.0"

paths:
/:
get:
operationId: "myOperation"
tags: ["myTag"]
summary: an operation
responses:
'200':
description: a pet to be returned
content:
application/json:
schema:
type: object
/withSpaces:
post:
operationId: "my Operation"
tags: ["my Tag"]
summary: an operation
responses:
'200':
description: a pet to be returned
content:
application/json:
schema:
type: object
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
swagger: "2.0"
swagger: "2.0"

paths:
/:
get:
operationId: "myOperation"
tags: ["myTag"]
summary: an operation
responses:
"200":
description: ok
/withSpaces:
post:
operationId: "my Operation"
tags: ["my Tag"]
summary: an operation
responses:
"200":
description: ok
45 changes: 42 additions & 3 deletions test/e2e-cypress/tests/deep-linking.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
describe("The Home Page", function () {
it("successfully loads", function () {
cy.visit("/")
describe("Deep linking feature", () => {
describe("in Swagger 2", () => {
beforeEach(() => {
cy.visit("/?deepLinking=true&url=/documents/features/deep-linking.swagger.yaml")
})
it("should generate an element ID and URL fragment for an operation", () => {
cy.get(".opblock-get")
.should("exist")
.should("have.id", "operations-myTag-myOperation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/myTag/myOperation")
})
it("should generate an element ID and URL fragment for an operation with spaces", () => {
cy.get(".opblock-post")
.should("exist")
.should("have.id", "operations-my_Tag-my_Operation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/my%20Tag/my%20Operation")
})
})
describe("in OpenAPI 3", () => {
beforeEach(() => {
cy.visit("/?deepLinking=true&url=/documents/features/deep-linking.openapi.yaml")
})
it("should generate an element ID and URL fragment for an operation", () => {
cy.get(".opblock-get")
.should("exist")
.should("have.id", "operations-myTag-myOperation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/myTag/myOperation")
})
it("should generate an element ID and URL fragment for an operation with spaces", () => {
cy.get(".opblock-post")
.should("exist")
.should("have.id", "operations-my_Tag-my_Operation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/my%20Tag/my%20Operation")
})
})
})