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

atlp-rwanda / knights-ecomm-fe / 9836581611

08 Jul 2024 08:57AM UTC coverage: 88.352% (+0.003%) from 88.349%
9836581611

push

github

web-flow
Merge pull request #55 from atlp-rwanda/ft-cart-managment

Implement Single Product View and Cart management (Guest and User)

503 of 689 branches covered (73.0%)

Branch coverage included in aggregate %.

635 of 722 new or added lines in 17 files covered. (87.95%)

6 existing lines in 2 files now uncovered.

6096 of 6780 relevant lines covered (89.91%)

8.01 hits per line

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

86.49
/src/components/Menu/DesktopMenu.tsx
1
import React from 'react';
1✔
2
import { AppDispatch } from '../../redux/store';
1✔
3
import { clearCredentials } from '../../redux/reducers/authReducer';
1✔
4
import { useDispatch } from 'react-redux';
1✔
5
import { clearUser } from '../../redux/reducers/userReducer';
1✔
6
import { useNavigate } from 'react-router-dom';
1✔
7
import { Link } from 'react-router-dom';
1✔
8
import { fetchCart } from '../../redux/actions/cartAction';
1✔
9

1✔
10
function DesktopMenu() {
1✔
11
  const navigate = useNavigate();
1✔
12
  const dispatch = useDispatch<AppDispatch>();
1✔
13

1✔
14
  const logoutHandler = () => {
1✔
15
    dispatch(clearCredentials());
×
16
    dispatch(clearUser());
×
17
    navigate('/');
×
NEW
18
    dispatch(fetchCart());
×
UNCOV
19
  };
×
20

1✔
21
  return (
1✔
22
    <div className="bg-baseWhite border border-neutral-300 rounded-2 w-48 p-1 text-neutral-600">
1✔
23
      <ul className="flex flex-col ">
1✔
24
        <Link to={'/wishlist'}>
1✔
25
          <li className="hover:bg-neutral-300 pl-5 py-2 cursor-pointer">WishList</li>
1✔
26
        </Link>
1✔
27
        <li className="hover:bg-neutral-300 pl-5 py-2 cursor-pointer">Profile</li>
1✔
28
        <li onClick={logoutHandler} className="hover:bg-neutral-300 pl-5 py-2 cursor-pointer">
1✔
29
          Logout
1✔
30
        </li>
1✔
31
      </ul>
1✔
32
    </div>
1✔
33
  );
1✔
34
}
1✔
35

1✔
36
export default DesktopMenu;
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

© 2026 Coveralls, Inc