Skip to content

Commit fadaffc

Browse files
author
Eric Olkowski
committed
Removed timezone from dates in tests
1 parent 587fb8e commit fadaffc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/react-core/src/components/Timestamp/__tests__/Timestamp.test.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test('Renders with custom formatting when dateFormat and timeFormat are passed i
7070
});
7171

7272
test('Renders with only date when dateFormat is passed in', () => {
73-
render(<Timestamp date={new Date('1 Jan 2022 00:00:00 EST')} dateFormat={TimestampFormat.full} />);
73+
render(<Timestamp date={new Date(2022, 0, 1)} dateFormat={TimestampFormat.full} />);
7474

7575
expect(screen.getByText('Saturday, January 1, 2022')).toBeInTheDocument();
7676
});
@@ -171,17 +171,15 @@ test('Renders with pf-m-help-text class when tooltip is passed in with custom va
171171
});
172172

173173
test('Renders with default tooltip content for default variant', () => {
174-
render(
175-
<Timestamp date={new Date('1 Jan 2022 00:00:00 EST')} tooltip={{ variant: TimestampTooltipVariant.default }} />
176-
);
174+
render(<Timestamp date={new Date(2022, 0, 1, 0, 0, 0)} tooltip={{ variant: TimestampTooltipVariant.default }} />);
177175

178176
expect(screen.getByText('1/1/2022, 5:00:00 AM UTC')).toBeInTheDocument();
179177
});
180178

181179
test('Renders with custom tooltip suffix for default variant', () => {
182180
render(
183181
<Timestamp
184-
date={new Date('1 Jan 2022 00:00:00 EST')}
182+
date={new Date(2022, 0, 1, 0, 0, 0)}
185183
tooltip={{ variant: TimestampTooltipVariant.default, suffix: 'Coordinated Universal Time' }}
186184
/>
187185
);

0 commit comments

Comments
 (0)