Skip to content

Commit db7768a

Browse files
committed
fix/broken test on timestamp change
1 parent eadf70d commit db7768a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

client/tests/src/components/profile/__snapshots__/profile.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ exports[`The profile component will render for logged in user 1`] = `
324324
className="recentDescription"
325325
key="62dc633b2464e19567160cb3"
326326
>
327-
Stub, 6 days ago
327+
Stub, 7 days ago
328328
<FontAwesomeIcon
329329
beat={false}
330330
beatFade={false}
@@ -395,7 +395,7 @@ exports[`The profile component will render for logged in user 1`] = `
395395
className="recentDescription"
396396
key="62e3f935616501f9bd180a71"
397397
>
398-
17 hours ago
398+
21 hours ago
399399
<FontAwesomeIcon
400400
beat={false}
401401
beatFade={false}

client/tests/src/components/profile/profile.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import { stubProfile } from '../../../stub'
77

88
jest.mock('axios')
99

10+
// Fix date to match snapshot both locally and github
11+
const utcFixedDate = new Date(Date.UTC(2022, 6, 30, 12, 35, 0))
12+
Date.now = jest.fn(() => utcFixedDate);
13+
14+
1015
describe('The profile component', () => {
1116
let props;
1217
beforeEach(() => {

0 commit comments

Comments
 (0)