feat: add tests (#843)
This commit is contained in:
parent
95a2af2535
commit
9dd9a9898c
35 changed files with 1063 additions and 191 deletions
|
|
@ -3,7 +3,7 @@
|
|||
import Link from 'next/link';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useActionState, useEffect, useState } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
import { toast } from '@/components/toast';
|
||||
|
||||
import { AuthForm } from '@/components/auth-form';
|
||||
import { SubmitButton } from '@/components/submit-button';
|
||||
|
|
@ -25,9 +25,15 @@ export default function Page() {
|
|||
|
||||
useEffect(() => {
|
||||
if (state.status === 'failed') {
|
||||
toast.error('Invalid credentials!');
|
||||
toast({
|
||||
type: 'error',
|
||||
description: 'Invalid credentials!',
|
||||
});
|
||||
} else if (state.status === 'invalid_data') {
|
||||
toast.error('Failed validating your submission!');
|
||||
toast({
|
||||
type: 'error',
|
||||
description: 'Failed validating your submission!',
|
||||
});
|
||||
} else if (state.status === 'success') {
|
||||
setIsSuccessful(true);
|
||||
router.refresh();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue