Fix tests in frontend

This commit is contained in:
2026-04-24 09:32:24 +02:00
parent 867c06295c
commit ee0bb780c1
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -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 () => {
+2
View File
@@ -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: {