-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arf/74185/arp landing page sign in link (#28225)
* ARF-74185 remove unused feature toggle mock * ARF-74185 add USiP link to ARP landing page ARF-74185 cypress test USiP link on ARP landing page * ARF-74185 fix ARP authReturnUrl * ARF-74185 fix ARP OAuth client ID * ARF-74185 fix lint * ARF-74185 fix ARP feature toggle and spec * ARF-74185 update ARP client ID * ARF-74185 update comment around ARP's USiP path constant * ARF-74185 change ARP sign-in link to actual link but button-styled
- Loading branch information
Showing
11 changed files
with
94 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import * as USIP from './usip'; | ||
|
||
export const SIGN_IN_URL = (function getSignInUrl() { | ||
const url = new URL(USIP.PATH, USIP.BASE_URL); | ||
url.searchParams.set(USIP.QUERY_PARAMS.application, USIP.APPS.ARP); | ||
url.searchParams.set(USIP.QUERY_PARAMS.OAuth, true); | ||
return url; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import environment from '@department-of-veterans-affairs/platform-utilities/environment'; | ||
|
||
// To keep isolated application status, this is hardcoded rather than cross-app | ||
// imported from `login/manifest.json`. | ||
// https://depo-platform-documentation.scrollhelp.site/developer-docs/how-to-add-your-application-to-the-allow-list | ||
export const PATH = '/sign-in'; | ||
export const { BASE_URL } = environment; | ||
|
||
export { | ||
AUTH_PARAMS as QUERY_PARAMS, | ||
EXTERNAL_APPS as APPS, | ||
} from 'platform/user/authentication/constants'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 51 additions & 27 deletions
78
src/applications/representatives/tests/e2e/representatives.cypress.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,57 @@ | ||
import { generateFeatureToggles } from '../../mocks/feature-toggles'; | ||
|
||
describe('Representatives', () => { | ||
beforeEach(() => { | ||
cy.intercept('GET', '/v0/feature_toggles*', { | ||
data: { | ||
features: [{ name: 'representatives_portal_frontend', value: true }], | ||
}, | ||
const togglePortal = value => { | ||
beforeEach(() => { | ||
cy.intercept('GET', '/v0/feature_toggles*', { | ||
data: { | ||
features: [{ name: 'representatives_portal_frontend', value }], | ||
}, | ||
}); | ||
}); | ||
}; | ||
|
||
describe('when feature is toggled off', () => { | ||
togglePortal(false); | ||
|
||
it('gates', () => { | ||
cy.visit('/representatives'); | ||
cy.injectAxe(); | ||
cy.axeCheck(); | ||
|
||
cy.location('pathname').should('equal', '/'); | ||
}); | ||
}); | ||
|
||
it('allows navigation from landing page to dashboard to poa requests', () => { | ||
cy.visit('/representatives') | ||
.injectAxe() | ||
.axeCheck(); | ||
generateFeatureToggles(); | ||
cy.contains('Welcome to Representative.VA.gov'); | ||
cy.contains('Until sign in is added use this to see dashboard').click(); | ||
|
||
cy.url() | ||
.should('include', '/representatives/dashboard') | ||
.injectAxe() | ||
.axeCheck(); | ||
cy.contains('Accredited Representative Portal'); | ||
cy.contains('Manage power of attorney requests').click(); | ||
|
||
cy.url().should('include', '/representatives/poa-requests'); | ||
cy.injectAxe(); | ||
cy.axeCheck(); | ||
cy.contains('Power of attorney requests'); | ||
cy.get('[data-testid=poa-requests-table]').should('exist'); | ||
describe('when feature is toggled on', () => { | ||
togglePortal(true); | ||
|
||
it('allows navigation from landing page to dashboard to poa requests', () => { | ||
cy.visit('/representatives'); | ||
cy.injectAxe(); | ||
cy.axeCheck(); | ||
|
||
cy.contains('Welcome to Representative.VA.gov'); | ||
cy.contains('Until sign in is added use this to see dashboard').click(); | ||
|
||
cy.url().should('include', '/representatives/dashboard'); | ||
cy.axeCheck(); | ||
|
||
cy.contains('Accredited Representative Portal'); | ||
cy.contains('Manage power of attorney requests').click(); | ||
|
||
cy.url().should('include', '/representatives/poa-requests'); | ||
cy.axeCheck(); | ||
|
||
cy.contains('Power of attorney requests'); | ||
cy.get('[data-testid=poa-requests-table]').should('exist'); | ||
}); | ||
|
||
it('allows navigation from landing page to unified sign-in page', () => { | ||
cy.visit('/representatives'); | ||
cy.injectAxe(); | ||
cy.axeCheck(); | ||
|
||
cy.contains('Sign in or create an account').click(); | ||
cy.url().should('include', '/sign-in/?application=arp&oauth=true'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters