diff --git a/src/core/plugins/oas3/components/servers.jsx b/src/core/plugins/oas3/components/servers.jsx index 948b4296f44..37c3f386e51 100644 --- a/src/core/plugins/oas3/components/servers.jsx +++ b/src/core/plugins/oas3/components/servers.jsx @@ -109,7 +109,8 @@ export default class Servers extends React.Component { ( server ) => diff --git a/test/e2e-cypress/static/documents/bugs/6351.yaml b/test/e2e-cypress/static/documents/bugs/6351.yaml new file mode 100644 index 00000000000..853953eefca --- /dev/null +++ b/test/e2e-cypress/static/documents/bugs/6351.yaml @@ -0,0 +1,13 @@ +openapi: 3.0.2 +info: + title: OAS 3.0 sample with multiple servers + version: 0.1.0 +servers: + - url: http://testserver1.com + - url: http://testserver2.com +paths: + /test/: + get: + responses: + '200': + description: Successful Response diff --git a/test/e2e-cypress/tests/bugs/6351.js b/test/e2e-cypress/tests/bugs/6351.js new file mode 100644 index 00000000000..63c37b71257 --- /dev/null +++ b/test/e2e-cypress/tests/bugs/6351.js @@ -0,0 +1,13 @@ +// http://github.com/swagger-api/swagger-ui/issues/6351 + +describe("#6351: Server dropdown should change when switched via oas3Actions.setSelectedServer", () => { + it("should show different selected server", () => { + cy.visit("/?url=/documents/bugs/6351.yaml") + .get("select") + .contains("http://testserver1.com") + .window() + .then(win => win.ui.oas3Actions.setSelectedServer("http://testserver2.com")) + .get("select") + .contains("http://testserver2.com") + }) +})