From f06d2666f2f75278b15183e76cbb577425dbaabe Mon Sep 17 00:00:00 2001 From: David Ma <40131297+davidma415@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:16:16 -0700 Subject: [PATCH] feat(app-reg-v2): autoselect strategy from modal if param is present (#404) --- cypress/e2e/specs/application_registration.spec.ts | 4 +++- src/components/ViewSpecRegistrationModal.vue | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/specs/application_registration.spec.ts b/cypress/e2e/specs/application_registration.spec.ts index d8cf6fc5..5aa37ae2 100644 --- a/cypress/e2e/specs/application_registration.spec.ts +++ b/cypress/e2e/specs/application_registration.spec.ts @@ -989,7 +989,9 @@ describe('Application Registration', () => { cy.get('[data-testid="app-reg-v2-register-btn"]', { timeout: 12000 }).click() cy.get(selectors.appRegModal).should('exist') cy.get(`${selectors.appRegModal} [data-testid="create-application"]`).should('exist') - cy.get(`${selectors.appRegModal} [data-testid="create-application"]`).should('have.prop', 'href').should('contain', `/application/create?product=${productWithKeyAuthAppAuthStrategy.id}&product_version=${versionWithKeyAuthAuthStrategy.id}&auth-strategy-id=${versionWithKeyAuthAuthStrategy.registration_configs[0].id}`) + cy.get(`${selectors.appRegModal} [data-testid="create-application"]`) + .should('have.prop', 'href') + .should('contain', `/application/create?product=${productWithKeyAuthAppAuthStrategy.id}&product_version=${versionWithKeyAuthAuthStrategy.id}&auth_strategy_id=${versionWithKeyAuthAuthStrategy.registration_configs[0].id}`) }) it('does not show select available scopes if no scopes are available - feature flag on', () => { diff --git a/src/components/ViewSpecRegistrationModal.vue b/src/components/ViewSpecRegistrationModal.vue index ced9c42c..b102c560 100644 --- a/src/components/ViewSpecRegistrationModal.vue +++ b/src/components/ViewSpecRegistrationModal.vue @@ -254,7 +254,7 @@ export default defineComponent({ product: $route.params.product, product_version: $route.params.product_version, ...(useAppRegV2 && authStrategyId.value) - ? { 'auth-strategy-id': authStrategyId.value } + ? { auth_strategy_id: authStrategyId.value } : {} } })