Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock Date for snapshots. #614

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions shared/src/components/Footer/Footer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import React from "react";
import { Footer } from "./Footer";

describe("Footer", () => {
beforeEach(() => {
const mockDate = new Date(2020, 1, 1, 0, 0, 0);
jest
.spyOn(global, 'Date')
.mockImplementation(() => mockDate)
});

afterEach(() => {
jest.resetModules();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exports[`Footer renders 1`] = `
className="u-remove-max-width"
>
©
2019
2020
Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.
</p>
</div>
Expand Down