Create universal date mock for jest tests

Summary

In a few places in our application we display information to the user relative to the "current date", when testing we are creating mocks for global.Date in each file its needed in.

/cc @pslaughter @winh @fatihacet @ekigbo

Improvements

I am proposing creating a universal function that we can import and call in our beforeAll to mock the date to a specific point in time. If no date is passed we can provide a default.

I think we will need to mock the Date constructor and Date.now to give the consumer options.

Risks

Involved components

specs/frontend/

Optional: Intended side effects

Optional: Missing test coverage

Edited Oct 25, 2019 by Scott Stern
Assignee Loading
Time tracking Loading