Skip to content

Commit 479a470

Browse files
committed
fix(calendar): remove timezone-dependent value attribute from snapshot
The value and mode props were being spread onto the root <div> via otherProps, causing Date.toString() to render a timezone-specific string. This made the snapshot test fail in CI (UTC) vs local dev environments. Destructure value and mode out before spreading.
1 parent 824076e commit 479a470

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

components/calendar/__tests__/__snapshots__/calendar.test.tsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ exports[`<Calendar /> should match the snapshot 1`] = `
44
<DocumentFragment>
55
<div
66
class="ty-calendar ty-calendar_fullscreen"
7-
value="Mon Jan 15 2024 00:00:00 GMT+1100 (Australian Eastern Daylight Time)"
87
>
98
<div
109
class="ty-calendar__header"

components/calendar/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const Calendar = React.forwardRef<HTMLDivElement, CalendarProps>((props, ref) =>
3434
onChange,
3535
onSelect,
3636
onPanelChange,
37+
value: _value,
38+
mode: _mode,
3739
...otherProps
3840
} = props;
3941

0 commit comments

Comments
 (0)