Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { useState } from 'react';
import { expect, screen, userEvent, waitFor, within } from 'storybook/test';
import { vi } from 'vitest';
import DsDateInput from './ds-date-input';
import type { DsDateInputProps } from './ds-date-input.types';
import styles from './ds-date-input.stories.module.scss';

// Mock system time to January 15, 2026 for consistent test dates
const MOCK_DATE = new Date('2026-01-15T12:00:00');

const meta: Meta<typeof DsDateInput> = {
title: 'Design System/DateInput',
component: DsDateInput,
tags: ['autodocs'],
parameters: {
layout: 'centered',
},
beforeEach: () => {
vi.useFakeTimers({
// needed,
shouldAdvanceTime: true,
});
vi.setSystemTime(MOCK_DATE);

return () => {
vi.useRealTimers();
};
Comment on lines +26 to +28
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whatttt
i didn't know that!

},
};

export default meta;
Expand Down