diff --git a/src/core/components/auth/auths.jsx b/src/core/components/auth/auths.jsx
index c2a51ead..57a85058 100644
--- a/src/core/components/auth/auths.jsx
+++ b/src/core/components/auth/auths.jsx
@@ -88,8 +88,8 @@ export default class Auths extends React.Component {
}
{
- nonOauthDefinitions.size === authorizedAuth.size ?
- :
+ nonOauthDefinitions.size === authorizedAuth.size ?
+ :
}
diff --git a/src/core/components/auth/oauth2.jsx b/src/core/components/auth/oauth2.jsx
index 487004c9..d41a9035 100644
--- a/src/core/components/auth/oauth2.jsx
+++ b/src/core/components/auth/oauth2.jsx
@@ -268,8 +268,8 @@ export default class Oauth2 extends React.Component {
}
{ isValid &&
- ( isAuthorized ?
- :
+ ( isAuthorized ?
+ :
)
}
diff --git a/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js b/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js
index 41a66cae..653d890e 100644
--- a/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js
+++ b/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js
@@ -14,6 +14,15 @@ describe("OAuth2 Application flow", function() {
.should("have.id", "oauth_username")
})
+ it("should have specific OAuth2 description for authorization button", () => {
+ cy
+ .visit("/?url=http://localhost:3231/swagger.yaml")
+ .get(".btn.authorize")
+ .click()
+ .get(".auth-btn-wrapper > .authorize")
+ .should("have.attr", "aria-label", "Apply given OAuth2 credentials")
+ })
+
it("should make an application flow Authorization header request", () => {
cy
.visit("/?url=http://localhost:3231/swagger.yaml")
diff --git a/test/e2e-cypress/e2e/security/apikey.cy.js b/test/e2e-cypress/e2e/security/apikey.cy.js
new file mode 100644
index 00000000..1e66ed05
--- /dev/null
+++ b/test/e2e-cypress/e2e/security/apikey.cy.js
@@ -0,0 +1,13 @@
+describe("ApiKey Authorization", function() {
+ it("should have generic description for authorization button", () => {
+ cy
+ .visit("/?url=/documents/petstore.swagger.yaml")
+ .get(".btn.authorize") // open authorization dialog
+ .click()
+ .get(".modal-ux-content > :nth-child(2)") // only deal with api_key for this test
+ .within(() => {
+ cy.get(".auth-btn-wrapper .authorize")
+ .should("have.attr", "aria-label", "Apply credentials")
+ })
+ })
+})