-
Notifications
You must be signed in to change notification settings - Fork 42
/
mocks.web.js
51 lines (47 loc) · 1.76 KB
/
mocks.web.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";
export const UserState = mockUserState();
jest.mock("react-helmet-async", () => ({ Helmet: "Helmet" }));
// eslint-disable-next-line global-require
jest.mock("@times-components/ad", () => ({
__esModule: true,
AdContainer: "AdContainer"
}));
jest.mock("@times-components/article-byline", () => ({
ArticleBylineWithLinks: "ArticleBylineWithLinks",
hasBylineData: () => true
}));
jest.mock("@times-components/article-extras", () => "ArticleExtras");
jest.mock("@times-components/article-flag", () => ({
ArticleFlags: "ArticleFlags"
}));
jest.mock("@times-components/article-image", () => "ArticleImage");
jest.mock("@times-components/article-topics", () => "ArticleTopics");
jest.mock("@times-components/date-publication", () => "DatePublication");
jest.mock("@times-components/image", () => "Image");
jest.mock("@times-components/interactive-wrapper", () => "InteractiveWrapper");
jest.mock("@times-components/link", () => ({
__esModule: true,
default: "Link",
TextLink: "TextLink"
}));
jest.mock("@times-components/pull-quote", () => "PullQuote");
jest.mock("@times-components/related-articles", () => "RelatedArticles");
jest.mock("@times-components/video-label", () => "VideoLabel");
jest.mock("@times-components/sticky", () => {
const actualSticky = jest.requireActual("@times-components/sticky");
const { css } = jest.requireActual("styled-components");
function mockComputeProgressStyles(computer) {
return css`
&[MOCK-PROGRESS-SELECTOR] {
${computer(0.05)};
}
`;
}
return {
__esModule: true,
...actualSticky,
computeProgressStyles: mockComputeProgressStyles,
PROGRESS_ATTR_NAME: "MOCK-PROGRESS-SELECTOR"
};
});