Skip to content

Commit

Permalink
Merge branch 'main' into fix/CMD-172-10px-font-size-not-accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
jarosenb authored Jul 10, 2024
2 parents dd5fcda + 34a57f6 commit 4ed7d28
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,25 @@ describe('LoginComponent', () => {
).toEqual(1)
);
});
it('should link to TAS Create Account if Create Account clicked', async () => {
it('should link to TAM', async () => {
const { getByText, getAllByRole } = testRender(<LoginComponent />);
await waitFor(() => getAllByRole('link'));
const links: HTMLElement[] = getAllByRole('link');
expect(getByText('Create Account')).toBeDefined();
expect(links[0].getAttribute('href')).toEqual(
'https://accounts.tacc.utexas.edu/register'
);
expect(getByText('Reset Password')).toBeDefined();
expect(getByText('Account Help')).toBeDefined();
expect(links[1].getAttribute('href')).toEqual(
'https://accounts.tacc.utexas.edu/login_support'
);
expect(getByText('Forgot Password')).toBeDefined();
expect(links[2].getAttribute('href')).toEqual(
'https://accounts.tacc.utexas.edu/forgot_password'
);
expect(getByText('Account Help')).toBeDefined();
expect(links[2].getAttribute('href')).toEqual('/about/help/');
expect(getByText('Recover Username')).toBeDefined();
expect(links[3].getAttribute('href')).toEqual(
'https://accounts.tacc.utexas.edu/forgot_username'
);
});
});
34 changes: 29 additions & 5 deletions libs/tup-components/src/auth/LoginComponent/LoginComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ const LoginError: React.FC<{ status?: number; isError: boolean }> = ({
<div className="c-form__errors">
Sorry, we can't find an account matching those credentials.
<br />
Please try again or <a href="/account/create">create a new account</a>.
Please try again or{' '}
<a
rel="noopener noreferrer"
target="_blank"
href="https://accounts.tacc.utexas.edu/register"
>
create a new account
</a>
.
</div>
);
}
Expand All @@ -52,18 +60,32 @@ const CreateAccountLink = () => (
);

const AccountHelpLink = () => (
<a href="/about/help/" target="_blank" rel="noreferrer">
<a
href="https://accounts.tacc.utexas.edu/login_support"
target="_blank"
rel="noreferrer"
>
Account Help
</a>
);

const ResetPasswordLink = () => (
const ForgotPasswordLink = () => (
<a
href="https://accounts.tacc.utexas.edu/forgot_password"
target="_blank"
rel="noreferrer"
>
Reset Password
Forgot Password
</a>
);

const ForgotUsernameLink = () => (
<a
href="https://accounts.tacc.utexas.edu/forgot_username"
target="_blank"
rel="noreferrer"
>
Recover Username
</a>
);

Expand Down Expand Up @@ -145,8 +167,10 @@ const LoginComponent: React.FC<LoginProps> = ({ className }) => {
</Formik>
<div className="c-form__nav">
<p>Having trouble logging in?</p>
<ResetPasswordLink />
{/* CAUTION: Do not exceed three links. If more needed, ask design. */}
<AccountHelpLink />
<ForgotPasswordLink />
<ForgotUsernameLink />
</div>
</div>
);
Expand Down

0 comments on commit 4ed7d28

Please sign in to comment.