Skip to content

Commit

Permalink
fix(#273): remove the hard-coded data-testid
Browse files Browse the repository at this point in the history
  • Loading branch information
CorinaMurg committed Jul 7, 2024
1 parent 9777134 commit a1efcba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions app/register/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ const Register = (): JSX.Element => {
</h1>
<p className="pb-4 font-normal leading-7 text-zinc-500">
If you have an existing account{' '}
<LinkCustom href="/login">Login!</LinkCustom>
<LinkCustom
href="/login"
data-testid="login-link"
>
Login!
</LinkCustom>
</p>

<Form {...form}>
Expand Down Expand Up @@ -214,7 +219,12 @@ const Register = (): JSX.Element => {
disabled={isDisabled}
/>
<p className="pb-4 font-normal leading-7 text-zinc-500">
<LinkCustom href="/login">Login</LinkCustom>
<LinkCustom
href="/login"
data-testid="login-link"
>
Login
</LinkCustom>
{' '} to get started playing
</p>

Expand Down
4 changes: 2 additions & 2 deletions components/LinkCustom/LinkCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ interface ILinkCustomProps {
* @param props.href - this is the URL you want the link to point to
* @returns The custom link component
*/
const LinkCustom = ({ children, href }: ILinkCustomProps): JSX.Element => {
const LinkCustom = ({ children, href, ... props }: ILinkCustomProps): JSX.Element => {
return (
<Link
className={'font-bold text-orange-600 hover:text-orange-600 hover:underline'}
data-testid="linkCustom"
href={href}
passHref
{ ...props }
>
{children}
</Link>
Expand Down

0 comments on commit a1efcba

Please sign in to comment.