This commit is contained in:
Philippe Torrel
2026-11-06 10:45:42 +01:00
parent 24dacde5a9
commit 38867d737c
11 changed files with 8226 additions and 9 deletions
File diff suppressed because it is too large Load Diff
@@ -30,7 +30,7 @@
"@vitejs/plugin-react": "^6.2.1",
"@vitest/ui": "^5.1.0",
"babel-plugin-react-compiler": "^1.0.0",
"jsdom": "^30.1.3",
"jsdom": "^31.0.0",
"oxlint": "^1.91.0",
"typescript": "~7.0.2",
"vite": "^8.3.6",
@@ -1,13 +1,11 @@
import { describe, it, expect } from 'vitest';
import { fakeProducts } from './__mocks__/products.mock';
import { fakeProducts as products } from './__mocks__/products.mock';
import ProductList from '../components/ProductList';
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
const products = fakeProducts;
describe('ProductList', () => {
it('should render the correct number of products', () => {
render(
@@ -16,7 +14,7 @@ describe('ProductList', () => {
</MemoryRouter>,
);
// screen.debug();
screen.debug();
const headings = screen.getAllByRole('heading', { level: 3 });
expect(headings).toHaveLength(products.length);
@@ -2,7 +2,8 @@ import { describe, expect, it } from 'vitest';
import { multiply } from '../utils/helpers';
describe('multiply', () => {
it('should return 10 when 2 and 5 are passed', () => {
// Test Cases
it('Multiply function should return 10 when 2 and 5 are passed', () => {
expect(multiply(2, 5)).toBe(10);
});
it('should return a number', () => {