fix: resolved model data invalidation (via #4858)
This commit is contained in:
13
test/e2e-cypress/static/documents/bugs/editor-1868.yaml
Normal file
13
test/e2e-cypress/static/documents/bugs/editor-1868.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
swagger: "2.0"
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
description: wow
|
||||
|
||||
definitions:
|
||||
MyModel:
|
||||
type: object
|
||||
properties:
|
||||
a:
|
||||
type: string
|
||||
26
test/e2e-cypress/tests/bugs/editor-1868.js
Normal file
26
test/e2e-cypress/tests/bugs/editor-1868.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import repeat from "lodash/repeat"
|
||||
|
||||
describe("Editor #1868: model changes break rendering", () => {
|
||||
it("should render model content changes correctly", () => {
|
||||
cy
|
||||
.visit("/?url=/documents/bugs/editor-1868.yaml")
|
||||
|
||||
.get(".model-toggle.collapsed")
|
||||
.click()
|
||||
|
||||
.get("#model-MyModel")
|
||||
.contains("a")
|
||||
|
||||
.window()
|
||||
.then(win => {
|
||||
// Simulate Swagger Editor updating a model
|
||||
const content = win.ui.specSelectors.specStr()
|
||||
win.ui.specActions.updateSpec(content + `\n b:\n type: string`)
|
||||
})
|
||||
|
||||
.get("#model-MyModel")
|
||||
.contains("a")
|
||||
.get("#model-MyModel")
|
||||
.contains("b")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user