Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* 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");
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";
export const UserState = mockUserState();
jest.mock("../src/head.web", () => "Head");
// 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", () => ({
ExclusiveArticleFlag: "ExclusiveArticleFlag",
NewArticleFlag: "NewArticleFlag",
/* 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");
/* 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");
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";
export const UserState = mockUserState();
jest.mock("@times-components/article-comments", () => "ArticleComments");
jest.mock("@times-components/article-topics", () => "ArticleTopics");
jest.mock("@times-components/related-articles", () => "RelatedArticles");
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";
export const UserState = mockUserState();
jest.mock("../src/bar-item", () => "BarItem");
jest.mock("@times-components/icons", () => ({
IconCopyLink: "IconCopyLink",
IconEmail: "IconEmail",
IconFacebook: "IconFacebook",
IconSaveBookmark: "IconSaveBookmark",
IconTwitter: "IconTwitter"
}));
jest.mock("react-native", () => {
const reactNativeMock = require.requireActual("react-native");
reactNativeMock.Clipboard = {
setString: jest.fn()
};
/* 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");
relatedArticlesVisible,
spotAccountId,
topics
}) => {
/* Nativo insert Sponsored Articles after the div#sponsored-article element. They are not able to insert directly into that element hence the container div */
const sponsoredArticles = (
<div id="sponsored-article-container">
<div id="sponsored-article">
</div>
);
return (
<div style="{clearingStyle}">
{(savingEnabled || sharingEnabled) && (
{({ showMessage }) => (
showMessage("Article link copied")}
onSaveToMyArticles={() => {}}
onShareOnEmail={() => {}}
savingEnabled={savingEnabled}
sharingEnabled={sharingEnabled}
/>
)}
</div></div>
sharingEnabled,
articleUrl,
articleHeadline,
relatedArticleSlice,
relatedArticlesVisible,
spotAccountId,
topics
}) => {
/* Nativo insert Sponsored Articles after the div#sponsored-article element. They are not able to insert directly into that element hence the container div */
const sponsoredArticles = (
<div id="sponsored-article-container">
<div id="sponsored-article">
</div>
);
return (
<div style="{clearingStyle}">
{(savingEnabled || sharingEnabled) && (
{({ showMessage }) => (
showMessage("Article link copied")}
onSaveToMyArticles={() => {}}
onShareOnEmail={() => {}}
savingEnabled={savingEnabled}
sharingEnabled={sharingEnabled}</div></div>
>
<header width="{articleWidth}">
{savingEnabled || sharingEnabled ? (
{({ showMessage }) => (
showMessage("Article link copied")
}
onSaveToMyArticles={() => {}}
onShareOnEmail={() => {}}
savingEnabled={savingEnabled}
sharingEnabled={sharingEnabled}
/>
)}
</header>