Skip to content

Commit

Permalink
test: update List.test.jsx and setup.js for improved test configurations
Browse files Browse the repository at this point in the history
- Added export for ONE_DAY_IN_MILLISECONDS in List.test.jsx to mock time-related functionality.
- Updated setup.js to resolve CSS file conflict by mocking `calculateEstimate` from `@the-collab-lab/shopping-list-utils`.
  • Loading branch information
kweeuhree committed Sep 14, 2024
1 parent b460117 commit 20505c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/List.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useStateWithStorage } from '../src/utils';

vi.mock('../src/utils', () => ({
useStateWithStorage: vi.fn(),
ONE_DAY_IN_MILLISECONDS: 86400000,
}));

beforeEach(() => {
Expand Down
5 changes: 5 additions & 0 deletions tests/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/vitest';
import { vi } from 'vitest';

vi.mock('@the-collab-lab/shopping-list-utils', () => ({
calculateEstimate: vi.fn(),
}));

0 comments on commit 20505c6

Please sign in to comment.