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
3 changes: 2 additions & 1 deletion src/core/plugins/oas3/components/servers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export default class Servers extends React.Component {
( server ) =>
<option
value={ server.get("url") }
key={ server.get("url") }>
key={ server.get("url") }
selected={ currentServer === server.get("url") }>
{ server.get("url") }
{ server.get("description") && ` - ${server.get("description")}` }
</option>
Expand Down
13 changes: 13 additions & 0 deletions test/e2e-cypress/static/documents/bugs/6351.yaml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions test/e2e-cypress/tests/bugs/6351.js
Original file line number Diff line number Diff line change
@@ -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")
})
})