diff --git a/Dockerfile b/Dockerfile index 453e090..ea0d743 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ FROM node as builder # ARG VITE_TDEI_API_URL ARG VITE_TDEI_USER_API_URL +ARG VITE_TDEI_PORTAL_URL ARG VITE_API_URL ARG VITE_NEW_API_URL ARG VITE_OSM_URL diff --git a/components/SigninForm.vue b/components/SigninForm.vue index c257d17..33508d6 100644 --- a/components/SigninForm.vue +++ b/components/SigninForm.vue @@ -3,6 +3,7 @@ @test e2e: the Sign In button is disabled until both username and password are entered @test e2e: invalid credentials (401) surface "Incorrect TDEI username/password." @test e2e: the show/hide toggle switches the password field between hidden and visible text + @test e2e: registration and password recovery link back to the configured TDEI Portal pages --> @@ -94,6 +106,9 @@ const username = ref('') const password = ref('') const showPassword = ref(false) const disabled = computed(() => loading.active || !username.value.length || !password.value.length) +const tdeiPortalUrl = import.meta.env.VITE_TDEI_PORTAL_URL +const registerUrl = new URL('/register', tdeiPortalUrl).toString() +const forgotPasswordUrl = new URL('/ForgotPassword', tdeiPortalUrl).toString() async function submit() { error.value = '' @@ -263,6 +278,32 @@ async function signIn() { color: #cc2c47; } +.signin-account-links { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 0.5rem; + margin-top: 2rem; + font-size: 0.9375rem; + line-height: 1.5; + color: $text-navy; + + a { + color: $primary; + font-weight: 600; + text-decoration: none; + + &:hover { + color: $primary-hover; + text-decoration: none; + } + } +} + +.signin-register-prompt { + margin: 0; +} + @include media-breakpoint-down(sm) { .signin-card { max-width: 100%; diff --git a/playwright.config.ts b/playwright.config.ts index f454fab..87410c7 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -12,6 +12,7 @@ const E2E_ENV = { VITE_NEW_API_URL: 'http://api.test/', VITE_TDEI_API_URL: 'http://api.test/tdei/', VITE_TDEI_USER_API_URL: 'http://api.test/tdei-user/', + VITE_TDEI_PORTAL_URL: 'https://portal.test', VITE_OSM_URL: 'http://api.test/osm/', VITE_RAPID_URL: 'http://api.test/rapid/', VITE_RAPID3_URL: 'http://api.test/rapid3/', diff --git a/test/e2e/signin.spec.ts b/test/e2e/signin.spec.ts index ef70c1d..bfa725a 100644 --- a/test/e2e/signin.spec.ts +++ b/test/e2e/signin.spec.ts @@ -96,4 +96,14 @@ test.describe('signin form', () => { await page.getByRole('button', { name: 'Hide password' }).click(); await expect(password).toHaveAttribute('type', 'password'); }); + + // @test e2e: registration and password recovery link back to the configured TDEI Portal pages + test('links to the TDEI Portal account pages', async ({ page }) => { + await page.goto('/signin'); + + await expect(page.getByRole('link', { name: 'Register Now', exact: true })) + .toHaveAttribute('href', 'https://portal.test/register'); + await expect(page.getByRole('link', { name: 'Forgot Password?', exact: true })) + .toHaveAttribute('href', 'https://portal.test/ForgotPassword'); + }); }); diff --git a/test/e2e/signin.spec.ts-snapshots/shows-the-sign-in-form-to-an-unauthenticated-visitor-1.aria.yml b/test/e2e/signin.spec.ts-snapshots/shows-the-sign-in-form-to-an-unauthenticated-visitor-1.aria.yml index a6d289c..2d54b3c 100644 --- a/test/e2e/signin.spec.ts-snapshots/shows-the-sign-in-form-to-an-unauthenticated-visitor-1.aria.yml +++ b/test/e2e/signin.spec.ts-snapshots/shows-the-sign-in-form-to-an-unauthenticated-visitor-1.aria.yml @@ -5,4 +5,11 @@ - text: Enter the same username that you provide to use the TDEI API. Password - textbox "Password" - button "Show password":  -- button "Sign In" [disabled] \ No newline at end of file +- button "Sign In" [disabled] +- navigation "TDEI account": + - paragraph: + - text: New to TDEI? + - link "Register Now": + - /url: /.+/ + - link "Forgot Password?": + - /url: /.+/