Skip to content
Open
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions components/SigninForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->
<template>
<div class="signin-card card">
Expand Down Expand Up @@ -80,6 +81,17 @@
>
{{ error }}
</div>

<nav
class="signin-account-links"
aria-label="TDEI account"
>
<p class="signin-register-prompt">
New to TDEI?
<a :href="registerUrl">Register Now</a>
</p>
<a :href="forgotPasswordUrl">Forgot Password?</a>
</nav>
</form>
</div>
</template>
Expand All @@ -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 = ''
Expand Down Expand Up @@ -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%;
Expand Down
1 change: 1 addition & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/signin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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]
- button "Sign In" [disabled]
- navigation "TDEI account":
- paragraph:
- text: New to TDEI?
- link "Register Now":
- /url: /.+/
- link "Forgot Password?":
- /url: /.+/
Loading