Skip to content

Commit

Permalink
fix timezone related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benrandja-akram committed May 21, 2024
1 parent 7f7853d commit 5daa5b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/stories/DatePicker/DatePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const meta = {
},
mockingDate: new Date(2024, 4, 10, 8, 0, 0),
},

args: {
fluid: false,
value: new Date(2024, 4, 10, 8, 0, 0),
Expand Down Expand Up @@ -226,7 +227,7 @@ export const ValueCanBeTyped: Story = {
await expect(year).toHaveTextContent('2023');
await expect(hour).toHaveTextContent('08');
await expect(minute).toHaveTextContent('30');
await expect(args.onChange).toHaveBeenLastCalledWith('2023-05-15T07:30:00.000Z');
await expect(args.onChange).toHaveBeenLastCalledWith('2023-05-15T08:30:00.000Z');
},
};
export const ValueCanBeCleared: Story = {
Expand All @@ -251,7 +252,7 @@ export const ValueCanBeCleared: Story = {
export const ValueCanBeChosenFromPopover: Story = {
args: {
popoverProps: {},
value: '2024-05-10T07:00:00.000Z',
value: '2024-05-10T08:00:00.000Z',
},
async play({ canvasElement, args }) {
const { month, year, day, hour, minute, input } = await getDateElements(canvasElement);
Expand All @@ -266,7 +267,7 @@ export const ValueCanBeChosenFromPopover: Story = {
await expect(year).toHaveTextContent('2024');
await expect(hour).toHaveTextContent('08');
await expect(minute).toHaveTextContent('00');
await expect(args.onChange).toHaveBeenLastCalledWith('2024-06-25T07:00:00.000Z');
await expect(args.onChange).toHaveBeenLastCalledWith('2024-06-25T08:00:00.000Z');
},
};

Expand Down Expand Up @@ -306,6 +307,6 @@ export const TimeCanBeChangedFromPopover: Story = {
await expect(hour).toHaveTextContent('10');
await expect(minute).toHaveTextContent('15');

await expect(args.onChange).toHaveBeenLastCalledWith('2024-05-10T09:15:00.000Z');
await expect(args.onChange).toHaveBeenLastCalledWith('2024-05-10T10:15:00.000Z');
},
};

0 comments on commit 5daa5b6

Please sign in to comment.