fix: response examples should respect media-type (#6456)

* response sample generation should take content type into consideration for stringify
This commit is contained in:
Mahtis Michel
2020-10-16 22:52:21 +02:00
committed by GitHub
parent 1226895294
commit 87ab4e9ac9
3 changed files with 132 additions and 22 deletions

View File

@@ -0,0 +1,33 @@
describe("#6442: 'Examples' keyword definitions can not be rendered as xml", () => {
it("should render response examples accourdingly to content-type xml", () => {
const xmlIndicator = "<x>should be xml</x>"
cy
.visit("?url=/documents/bugs/6442.yaml")
.get("#operations-default-xmlTest")
.click()
.get(".responses-wrapper")
.within(() => {
cy
.get(".microlight")
.should("include.text", xmlIndicator)
})
})
})
describe("#6442: 'Example' keyword definitions can not be rendered as xml", () => {
it("should render response examples accourdingly to content-type xml", () => {
const xmlIndicator = "<x>should be xml</x>"
cy
.visit("?url=/documents/bugs/6442.yaml")
.get("#operations-default-xmlTest2")
.click()
.get(".responses-wrapper")
.within(() => {
cy
.get(".microlight")
.should("include.text", xmlIndicator)
})
})
})