chore(deps): update react-syntax-highlighter from 12.2.1 to 13.5.0 (#6312)
* fix(cypress): use less restrictive 'include.text' assertion * includes prismjs@1.21.0 security update
This commit is contained in:
@@ -195,7 +195,7 @@ function RequestBodyPrimitiveTestCases({
|
||||
.click()
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Switch to Try-It-Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
@@ -221,7 +221,7 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(exampleB.key)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Switch to Try-It-Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
@@ -263,7 +263,7 @@ function RequestBodyPrimitiveTestCases({
|
||||
.click()
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
})
|
||||
|
||||
it("should return the dropdown entry for an example when manually returning to its value", () => {
|
||||
@@ -273,7 +273,7 @@ function RequestBodyPrimitiveTestCases({
|
||||
.click()
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Switch to Try-It-Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
@@ -294,7 +294,7 @@ function RequestBodyPrimitiveTestCases({
|
||||
// Assert on the dropdown value returning to the example value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
})
|
||||
|
||||
it("should retain choosing a member in static docs when changing the media type", () => {
|
||||
@@ -310,7 +310,7 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(secondaryMediaType)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Switch to Try-It-Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
@@ -336,7 +336,7 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(secondaryMediaType)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Switch to Try-It-Out
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
@@ -362,44 +362,44 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(secondaryMediaType)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
|
||||
// Choose exampleB
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.select(exampleB.key)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
|
||||
// Change the media type
|
||||
.get(".opblock-section-request-body .content-type")
|
||||
.select(primaryMediaType)
|
||||
// Assert that the static docs value didn't change
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Assert that the dropdown value didn't change
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
|
||||
// Choose exampleA
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.select(exampleA.key)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body .microlight`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
})
|
||||
|
||||
it("Try-It-Out toggling: mediaType -> example -> mediaType -> example", () => {
|
||||
@@ -415,44 +415,44 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(secondaryMediaType)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
|
||||
// Choose exampleB
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.select(exampleB.key)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
|
||||
// Change the media type
|
||||
.get(".opblock-section-request-body .content-type")
|
||||
.select(primaryMediaType)
|
||||
// Assert that the static docs value didn't change
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Assert that the dropdown value didn't change
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
|
||||
// Choose exampleA
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.select(exampleA.key)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
})
|
||||
|
||||
it("Try-It-Out toggling and execution with modified values: mediaType -> modified value -> example -> mediaType -> example", () => {
|
||||
@@ -468,11 +468,11 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(secondaryMediaType)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
|
||||
// Modify the value
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
@@ -497,11 +497,11 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(exampleB.key)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
// Fire the operation
|
||||
.get(".execute")
|
||||
.click()
|
||||
@@ -519,11 +519,11 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(primaryMediaType)
|
||||
// Assert that the static docs value didn't change
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
// Assert that the dropdown value didn't change
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
// Fire the operation
|
||||
.get(".execute")
|
||||
.click()
|
||||
@@ -541,11 +541,11 @@ function RequestBodyPrimitiveTestCases({
|
||||
.select(exampleA.key)
|
||||
// Assert on the static docs value
|
||||
.get(`.opblock-section-request-body textarea`)
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
// Assert on the dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
// Fire the operation
|
||||
.get(".execute")
|
||||
.click()
|
||||
@@ -592,9 +592,9 @@ function ResponsePrimitiveTestCases({
|
||||
.within(() => {
|
||||
cy.get(".examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
.get(".microlight")
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
})
|
||||
})
|
||||
it("should render the second example", () => {
|
||||
@@ -606,9 +606,9 @@ function ResponsePrimitiveTestCases({
|
||||
cy.get(".examples-select > select")
|
||||
.select(exampleB.key)
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
.get(".microlight")
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -624,10 +624,10 @@ function ResponsePrimitiveTestCases({
|
||||
.select(exampleB.key)
|
||||
// Assert against dropdown value
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
// Assert against example value
|
||||
.get(".microlight")
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
|
||||
// Change media types
|
||||
.get(".content-type")
|
||||
@@ -635,10 +635,10 @@ function ResponsePrimitiveTestCases({
|
||||
// Assert against dropdown value
|
||||
.get(".examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleB.summary)
|
||||
.should("include.text", exampleB.summary)
|
||||
// Assert against example value
|
||||
.get(".microlight")
|
||||
.should("have.text", exampleB.value)
|
||||
.should("include.text", exampleB.value)
|
||||
})
|
||||
})
|
||||
;(exampleC ? it : it.skip)(
|
||||
@@ -658,10 +658,10 @@ function ResponsePrimitiveTestCases({
|
||||
.select(exampleC.key)
|
||||
// Assert against dropdown value
|
||||
.find(":selected")
|
||||
.should("have.text", exampleC.summary || exampleC.key)
|
||||
.should("include.text", exampleC.summary || exampleC.key)
|
||||
// Assert against example value
|
||||
.get(".microlight")
|
||||
.should("have.text", exampleC.value)
|
||||
.should("include.text", exampleC.value)
|
||||
|
||||
// Change media types
|
||||
.get(".content-type")
|
||||
@@ -669,10 +669,10 @@ function ResponsePrimitiveTestCases({
|
||||
// Assert against dropdown value
|
||||
.get(".examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", exampleA.summary)
|
||||
.should("include.text", exampleA.summary)
|
||||
// Assert against example value
|
||||
.get(".microlight")
|
||||
.should("have.text", exampleA.value)
|
||||
.should("include.text", exampleA.value)
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
@@ -390,7 +390,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.click()
|
||||
// Check HighlightCode value
|
||||
.get(".opblock-section-request-body .highlight-code")
|
||||
.should("have.text", JSON.stringify(["a", "b", "c"], null, 2))
|
||||
.should("include.text", JSON.stringify(["a", "b", "c"], null, 2))
|
||||
// Check dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
@@ -415,7 +415,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.select("ArrayExampleB")
|
||||
.get(".opblock-section-request-body .highlight-code")
|
||||
.should("have.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
.should("include.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
.should("have.text", "A lowly array of numbers")
|
||||
@@ -424,7 +424,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.click()
|
||||
// Check textarea value
|
||||
.get(".opblock-section-request-body textarea")
|
||||
.should("have.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
.should("include.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
// Check dropdown value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.find(":selected")
|
||||
@@ -451,7 +451,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.should("have.text", "[Modified value]")
|
||||
// Check textarea value
|
||||
.get(".opblock-section-request-body textarea")
|
||||
.should("have.text", JSON.stringify([1, 2, 3, 4, 5], null, 2))
|
||||
.should("include.text", JSON.stringify([1, 2, 3, 4, 5], null, 2))
|
||||
})
|
||||
|
||||
it("should retain a modified value, and support returning to it", () => {
|
||||
@@ -475,7 +475,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.should("have.text", "[Modified value]")
|
||||
// Check textarea value
|
||||
.get(".opblock-section-request-body textarea")
|
||||
.should("have.text", JSON.stringify([1, 2, 3, 4, 5], null, 2))
|
||||
.should("include.text", JSON.stringify([1, 2, 3, 4, 5], null, 2))
|
||||
// Choose the second example
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.select("ArrayExampleB")
|
||||
@@ -485,13 +485,13 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.should("have.text", "A lowly array of numbers")
|
||||
// Check textarea value
|
||||
.get(".opblock-section-request-body textarea")
|
||||
.should("have.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
.should("include.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
// Switch back to the modified value
|
||||
.get(".opblock-section-request-body .examples-select > select")
|
||||
.select("__MODIFIED__VALUE__")
|
||||
// Check textarea value
|
||||
.get(".opblock-section-request-body textarea")
|
||||
.should("have.text", JSON.stringify([1, 2, 3, 4, 5], null, 2))
|
||||
.should("include.text", JSON.stringify([1, 2, 3, 4, 5], null, 2))
|
||||
})
|
||||
})
|
||||
describe("in a Response", () => {
|
||||
@@ -507,7 +507,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.should("have.text", "A lowly array of strings")
|
||||
// Assert on the example value
|
||||
.get(".example.microlight")
|
||||
.should("have.text", JSON.stringify(["a", "b", "c"], null, 2))
|
||||
.should("include.text", JSON.stringify(["a", "b", "c"], null, 2))
|
||||
})
|
||||
it("should render and apply the second value when chosen", () => {
|
||||
cy.visit(
|
||||
@@ -522,7 +522,7 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => {
|
||||
.should("have.text", "A lowly array of numbers")
|
||||
// Assert on the example value
|
||||
.get(".example.microlight")
|
||||
.should("have.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
.should("include.text", JSON.stringify([1, 2, 3, 4], null, 2))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user