Fix tests in frontend
This commit is contained in:
@@ -15,8 +15,10 @@ describe('TimeAdjuster', () => {
|
||||
const { container } = render(<TimeAdjuster onTimeChange={handleChange} />);
|
||||
const input = container.querySelector('input');
|
||||
|
||||
vi.clearAllMocks();
|
||||
|
||||
fireEvent.change(input!, { target: { value: '2024-01-01T12:00' } });
|
||||
expect(handleChange).toHaveBeenCalledWith('2024-01-01T12:00');
|
||||
expect(handleChange).toHaveBeenCalledWith(new Date('2024-01-01T12:00').toISOString());
|
||||
});
|
||||
|
||||
it('resets to now when reset button is clicked', async () => {
|
||||
|
||||
@@ -8,6 +8,8 @@ export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
include: ['src/**/*.{test,spec}.{ts,tsx}', 'tests/**/*.{test,spec}.{ts,tsx}'],
|
||||
exclude: ['**/tests/e2e/**', '**/node_modules/**'],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user