Skip to content

Commit c7468ad

Browse files
committed
Tests: Mock date for snapshot
1 parent b3d1447 commit c7468ad

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/js/components/__snapshots__/notification.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ exports[`components/notification.js should render itself & its children 1`] = `
5050
</span>
5151
- Updated
5252
53-
over 2 years ago
53+
in over 3 years
5454
</div>
5555
</div>
5656
<div

src/js/components/notification.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ describe('components/notification.js', () => {
2828
});
2929

3030
it('should render itself & its children', async () => {
31+
(global as any).Date.now = jest.fn(() => new Date('2014'));
32+
3133
const props = {
3234
markNotification: jest.fn(),
3335
markOnClick: false,

0 commit comments

Comments
 (0)