Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update warning msg [TDX-4640] #556

Merged
merged 3 commits into from
Sep 27, 2024
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
15 changes: 14 additions & 1 deletion cypress/e2e/specs/application_registration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,25 @@ describe('Application Registration', () => {
cy.visit('/my-apps')

cy.get('[data-testid="create-application-button"]').should('exist')
cy.get('[data-testid="create-application-link"]').should('exist')
cy.get('[data-testid="create-application-link"]').should('not.exist')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add the contrapositive test for when it should be shown?

cy.get('[data-testid="empty-state-card"]')
.should('exist')
.should('contain', 'No Applications')
})

it('displays empty dashboard with enabled buttons', () => {
cy.mockApplications([], 0)
cy.mockApplicationAuthStrategies([{ name: 'foo', id: '1', credential_type: 'client_credentials', auth_methods: ['session', 'bearer'] }], 0)

cy.visit('/my-apps')

cy.get('[data-testid="create-application-button"]').should('exist')
cy.get('[data-testid="create-application-link"]').should('exist')
cy.get('[data-testid="empty-state-card"]')
.should('exist')
.should('contain', 'No Applications')
})

it('can return to My Apps from application details via breadcrumb', () => {
cy.mockDeveloperRefresh()
cy.mockApplications(apps, 4)
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export const en = {
logoAlt: 'logo'
},
myApp: {
authStrategyWarning: 'You cannot create an application as this developer portal has no available application auth strategies. Please contact a developer portal admin.',
authStrategyWarning: 'There are no APIs that require authentication published to this portal. Application creation is disabled.',
authStrategyFetchError: (errString: string) => `Error fetching auth strategies: ${errString}`,
newApp: 'New App',
plus: 'Plus',
Expand Down
2 changes: 1 addition & 1 deletion src/views/MyApps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
:title="searchStr ? helpText.noSearchResults : helpText.noApp"
>
<template #message>
<p>
<p v-if="hasAppAuthStrategies">
<router-link
data-testid="create-application-link"
:to="{
Expand Down
Loading