• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atlp-rwanda / hackers-ec-Fe / #176

20 Jun 2024 06:26AM UTC coverage: 89.009% (+0.6%) from 88.422%
#176

Pull #14

kwizera-bonheur25
feat(verify-email):User should be able to verify the email
Pull Request #14: #187742590 User should be able to verify the email

52 of 67 branches covered (77.61%)

Branch coverage included in aggregate %.

109 of 115 new or added lines in 5 files covered. (94.78%)

774 of 861 relevant lines covered (89.9%)

4.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/components/auth/VerifyAccount.tsx
1
import { useParams } from 'react-router-dom';
1✔
2
import { useAppDispatch } from '../../redux/hooks/hooks';
1✔
3
import { verify } from '../../redux/features/VerifyAccountSlice';
1✔
4
import { useEffect } from 'react';
1✔
5
import useToast from '../../hooks/useToast';
1✔
6
import { DynamicData } from '../../@types/DynamicData';
1✔
7
import VerifiedCard from '../cards/VerifiedCard';
1✔
8
import { useRef } from 'react';
1✔
9

1✔
10
const VerifyAccount = () => {
1✔
11
        const { showErrorMessage, showSuccessMessage } = useToast();
2✔
12
        const dispatch = useAppDispatch();
2✔
13
        const { token } = useParams();
2✔
14
        const effectRan = useRef(false);
2✔
15

2✔
16
        useEffect(() => {
2✔
17
                if (effectRan.current) return;
2!
18
                effectRan.current = true;
2✔
19
                const verifyUser = async () => {
2✔
20
                        try {
2✔
21
                                const res = await dispatch(verify(token as string)).unwrap();
2!
NEW
22
                                showSuccessMessage(res.message);
×
23
                        } catch (error) {
2✔
24
                                const err = error as DynamicData;
2✔
25
                                showErrorMessage(
2✔
26
                                        err?.data?.message ||
2!
27
                                                err?.message ||
2!
NEW
28
                                                'Unknown error occured! Please try again!',
×
29
                                );
2✔
30
                        }
2✔
31
                };
2✔
32
                verifyUser();
2✔
33
        }, [dispatch, showSuccessMessage, showErrorMessage, token]);
2✔
34
        return (
2✔
35
                <>
2✔
36
                        <VerifiedCard />
2✔
37
                </>
2✔
38
        );
2✔
39
};
2✔
40

1✔
41
export default VerifyAccount;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc