Skip to content
Merged
Changes from 2 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,29 @@
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();
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 All @@ -20,7 +32,7 @@
/**
* Basic single date input with default configuration
*/
export const Default: Story = {

Check failure on line 35 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > Default

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--default&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:35:7
render: function Render() {
const [value, setValue] = useState<string>();

Expand Down Expand Up @@ -82,7 +94,7 @@
/**
* Date range input - unified input field for start and end dates
*/
export const RangeMode: Story = {

Check failure on line 97 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > Range Mode

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--range-mode&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:97:7
render: function Render() {
const [value, setValue] = useState<[string, string]>();

Expand Down Expand Up @@ -160,7 +172,7 @@
/**
* Single date input with pre-filled value
*/
export const WithDefaultValue: Story = {

Check failure on line 175 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > With Default Value

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--with-default-value&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:175:7
args: {
className: styles.containerSingle,
defaultValue: '2024-12-25',
Expand All @@ -170,7 +182,7 @@
/**
* Range input with pre-filled values
*/
export const RangeWithDefaultValue: Story = {

Check failure on line 185 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > Range With Default Value

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--range-with-default-value&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:185:7
args: {
className: styles.containerRange,
defaultValue: ['2024-12-01', '2024-12-31'],
Expand All @@ -181,7 +193,7 @@
/**
* Date input with min and max constraints
*/
export const WithMinMax: Story = {

Check failure on line 196 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > With Min Max

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--with-min-max&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:196:7
render: function Render() {
const [value, setValue] = useState<string>();
const today = new Date();
Expand All @@ -206,7 +218,7 @@
/**
* Disabled date input
*/
export const Disabled: Story = {

Check failure on line 221 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > Disabled

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--disabled&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:221:7
args: {
className: styles.containerSingle,
value: '2024-12-25',
Expand All @@ -217,7 +229,7 @@
/**
* Read-only date input
*/
export const ReadOnly: Story = {

Check failure on line 232 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > Read Only

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--read-only&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:232:7
args: {
className: styles.containerSingle,
value: '2024-12-25',
Expand All @@ -228,7 +240,7 @@
/**
* Controlled open state
*/
export const ControlledOpen: Story = {

Check failure on line 243 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > Controlled Open

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--controlled-open&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:243:7
render: function Render() {
const [value, setValue] = useState<string>();
const [open, setOpen] = useState(false);
Expand All @@ -247,7 +259,7 @@
/**
* Uncontrolled with defaultValue
*/
export const Uncontrolled: Story = {

Check failure on line 262 in packages/design-system/src/components/ds-date-input/ds-date-input.stories.tsx

View workflow job for this annotation

GitHub Actions / Test

[storybook (chromium)] src/components/ds-date-input/ds-date-input.stories.tsx > Uncontrolled

Error: Click to debug the error directly in Storybook: http://localhost:6006/?path=/story/design-system-dateinput--uncontrolled&addonPanel=storybook/interactions/panel Test timed out in 15000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ _test src/components/ds-date-input/ds-date-input.stories.tsx:262:7
render: function Render() {
return (
<div className={styles.containerSingle}>
Expand Down
Loading