• 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/validations/productValidation.tsx
UNCOV
1
import { z } from "zod";
×
UNCOV
2

×
UNCOV
3
const productSchema = z.object({
×
UNCOV
4
  productName: z.string().min(1, "Product name is required").min(3, "Product name must be at least 3 characters").max(50, "Product name must not exceed 50 characters"),
×
UNCOV
5
  stockLevel: z.string().min(1, "Stock level is required").regex(/[0-9]$/, "Stock level must be a number"),
×
UNCOV
6
  productCategory: z.string().uuid("Invalid product category ID"),
×
UNCOV
7
  productPrice: z.string().min(1, "Product Price is required").regex(/[0-9]$/, "Product price must be a number"),
×
UNCOV
8
  productDiscount: z.string().regex(/[0-9]$/, "Product discount must be a number").optional(),
×
UNCOV
9
  currency: z.string().min(3, "Currency must be 3 characters").max(3, "Currency must be 3 characters").regex(/^[^0-9]+$/, "Currency must be a string with no numbers"),
×
UNCOV
10
 description: z.string().min(1, "Description is required").min(20, "Description must be at least 20 characters").max(500, "Description must not exceed 500 characters"),
×
UNCOV
11
  
×
UNCOV
12
  expireDate: z.string().min(1,"Expire date is required").refine((data) => {
×
13
    if (!data) return false;
×
14
    const expireDate = new Date(data);
×
15
    const currentDate = new Date();
×
16
    return expireDate > currentDate;
×
UNCOV
17
  }, {
×
UNCOV
18
    message: `The expire date must be a future date`
×
UNCOV
19
  })
×
UNCOV
20
});
×
UNCOV
21

×
UNCOV
22
const productUpdateSchema = productSchema; 
×
UNCOV
23

×
UNCOV
24
export { productSchema, productUpdateSchema };
×
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