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

atlp-rwanda / champs-ec-fe / 13ba735d-90f9-49d3-9acb-f5a6c957f324

18 Jun 2024 10:20PM UTC coverage: 58.852% (-28.3%) from 87.175%
13ba735d-90f9-49d3-9acb-f5a6c957f324

Pull #13

circleci

k3lly003
Merge pull request #26 from atlp-rwanda/ft-disable-users-#187300202

Ft disable users #187300202
Pull Request #13: feat(ProductView): ProductView (all/one) according to there user's role #187300196

70 of 95 branches covered (73.68%)

Branch coverage included in aggregate %.

84 of 626 new or added lines in 24 files covered. (13.42%)

219 existing lines in 7 files now uncovered.

1366 of 2345 relevant lines covered (58.25%)

2.27 hits per line

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

0.0
/src/app/page.tsx
UNCOV
1
'use client';
×
UNCOV
2
import React, { useState, useEffect } from 'react';
×
UNCOV
3
import { useForm } from 'react-hook-form';
×
UNCOV
4
import { zodResolver } from '@hookform/resolvers/zod';
×
UNCOV
5
import Link from 'next/link';
×
UNCOV
6
import GlobarPopUp from '@/components/UsablePopUp';
×
UNCOV
7
import PopUpModels from '@/components/PopUpModels';
×
NEW
8
import {Button} from '@/components/Button';
×
UNCOV
9
import InputBox from '@/components/InputBox';
×
UNCOV
10
import { Updatepassword } from '@/validations/Updatepassword';
×
UNCOV
11
import UpdatePassword from '@/hooks/updatepassword';
×
NEW
12
import Header from '@/components/Header';
×
UNCOV
13

×
UNCOV
14
export interface FormDataType {
×
UNCOV
15
  confirmPassword: string;
×
UNCOV
16
  newPassword: string;
×
UNCOV
17
  oldPassword: string;
×
UNCOV
18
}
×
UNCOV
19
export default function Home() {
×
UNCOV
20
  const [showlModal, setShowmodal] = useState(false);
×
UNCOV
21
  const {
×
UNCOV
22
    register,
×
UNCOV
23
    handleSubmit,
×
UNCOV
24
    formState: { errors },
×
UNCOV
25
    reset,
×
UNCOV
26
  } = useForm<FormDataType>({
×
UNCOV
27
    resolver: zodResolver(Updatepassword),
×
UNCOV
28
  });
×
UNCOV
29

×
UNCOV
30
  const onSubmit = (data: FormDataType) => {
×
31
    submit(data);
×
32
  };
×
UNCOV
33

×
UNCOV
34
  //Hooks
×
UNCOV
35
  let { submit, error, loading, success, handlemoduleButton } =
×
UNCOV
36
    UpdatePassword();
×
UNCOV
37
  const handleshow = () => {
×
38
    setShowmodal(!showlModal);
×
39
    reset();
×
40
  };
×
UNCOV
41

×
UNCOV
42
  return (
×
UNCOV
43
    <main className="flex min-h-screen flex-col items-center justify-between p-24">
×
NEW
44
      <Header/>
×
UNCOV
45
      <div className="bg-primaryBlue  rounded-md shadow-md hover:shadow-lg duration-200 cursor-pointer hover:scale-110">
×
UNCOV
46
        <p className="text-lg p-4">This is champs e commerce Homepage</p>
×
UNCOV
47
      </div>
×
UNCOV
48
      <div className="flex h-[20px] gap-10">
×
UNCOV
49
        <button className="bg-primaryBlue w-[80px] h-[40px]">
×
UNCOV
50
          <Link href="/auth/login" className="text-white">
×
UNCOV
51
            {' '}
×
UNCOV
52
            Login
×
UNCOV
53
          </Link>
×
UNCOV
54
        </button>
×
UNCOV
55
        <button className="bg-primaryBlue w-[80px] h-[40px]">
×
UNCOV
56
          <Link href="/auth/signup" className="text-white">
×
UNCOV
57
            {' '}
×
UNCOV
58
            Signup
×
UNCOV
59
          </Link>
×
UNCOV
60
        </button>
×
UNCOV
61

×
UNCOV
62
        <button
×
UNCOV
63
          className=" w-auto pb-3"
×
UNCOV
64
          onClick={() => setShowmodal(!showlModal)}
×
UNCOV
65
        >
×
UNCOV
66
          change password
×
UNCOV
67
        </button>
×
UNCOV
68

×
UNCOV
69
        <button className="bg-primaryBlue w-[80px] h-[40px]">
×
UNCOV
70
          <Link href="/admin" className="text-white">
×
UNCOV
71
            Admin
×
UNCOV
72
          </Link>
×
UNCOV
73
        </button>
×
UNCOV
74
      </div>
×
UNCOV
75
      {showlModal && (
×
UNCOV
76
        <GlobarPopUp handleShowModel={handleshow}>
×
UNCOV
77
          <div className="flex justify-center flex-col  mx-6 py-20">
×
UNCOV
78
            <form action="" onSubmit={handleSubmit(onSubmit)}>
×
UNCOV
79
              <InputBox
×
UNCOV
80
                type="password"
×
UNCOV
81
                nameuse="Old Password"
×
UNCOV
82
                placeholder="Old Password"
×
UNCOV
83
                {...register('oldPassword')}
×
UNCOV
84
                error={errors.oldPassword?.message as string}
×
UNCOV
85
              />
×
UNCOV
86
              <InputBox
×
UNCOV
87
                type="password"
×
UNCOV
88
                nameuse="New Password"
×
UNCOV
89
                placeholder="New Password"
×
UNCOV
90
                {...register('newPassword')}
×
UNCOV
91
                error={errors.newPassword?.message as string}
×
UNCOV
92
              />
×
UNCOV
93
              <InputBox
×
UNCOV
94
                type="Password"
×
UNCOV
95
                nameuse="Confirm Password"
×
UNCOV
96
                placeholder="Confirm Password"
×
UNCOV
97
                {...register('confirmPassword')}
×
UNCOV
98
                error={errors.confirmPassword?.message as string}
×
UNCOV
99
              />
×
UNCOV
100
              <h1 className="text-red-400"> {error}</h1>
×
UNCOV
101
              <div className="w-full mt-5">
×
UNCOV
102
                <Button name="Save" loading={loading} />
×
UNCOV
103
              </div>
×
UNCOV
104
            </form>
×
UNCOV
105
          </div>
×
UNCOV
106
        </GlobarPopUp>
×
UNCOV
107
      )}
×
UNCOV
108
      {success && (
×
UNCOV
109
        <PopUpModels
×
UNCOV
110
          handleButton={handlemoduleButton}
×
UNCOV
111
          testid="updatetest"
×
UNCOV
112
          bodyText=" Your password has been updated successfully. Next time, please remember to use the updated version !"
×
UNCOV
113
          topText="Password Updated  ✅"
×
UNCOV
114
          iconImagelink="/Verified.png"
×
UNCOV
115
        />
×
UNCOV
116
      )}
×
UNCOV
117
    </main>
×
UNCOV
118
  );
×
UNCOV
119
}
×
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