Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
SecondaryFourSlice,
SecondaryTwoNoPicAndTwoSlice,
SecondaryOneAndColumnistSlice,
SecondaryTwoAndTwoSlice,
StandardSlice,
ListTwoAndSixNoPicSlice
} from "../src/slices";
const slices = [
{
mock: mockCommentLeadAndCartoonSlice(),
name: "comment lead and cartoon",
Slice: CommentLeadAndCartoonSlice
},
{
mock: mockDailyRegisterSlice(),
name: "daily universal register",
Slice: DailyRegisterLeadFourSlice
},
{
mock: mockLeadOneAndOneSlice(),
name: "lead one and one",
Slice: LeadOneAndOneSlice
},
{
mock: mockLeadOneFullWidthSlice(),
name: "lead one full width",
Slice: LeadOneFullWidthSlice
},
{
mock: mockLeadTwoNoPicAndTwoSlice(),
name: "lead two no pic and two",
TileAR,
TileAS,
TileZ,
TileAF
} from "../src/tiles";
jest.mock("@times-components/article-flag", () => ({
ArticleFlags: "ArticleFlags"
}));
jest.mock("@times-components/image", () => "Image");
jest.mock("@times-components/link", () => "Link");
jest.mock("@times-components/gradient", () => "Gradient");
jest.mock("@times-components/article-label", () => "ArticleLabel");
const tile = mockEditionSlice(1).items[0];
const dailyRegisterItem = mockDailyRegisterSlice().birthdaysToday;
const testTile = (Tile, mockTile = tile) => {
const output = TestRenderer.create(
{}} tile={mockTile} />
);
expect(output).toMatchSnapshot();
};
const testPuzzleTile = Tile => {
const puzzle = mockPuzzleSlice();
const output = TestRenderer.create(
{}}
title={puzzle.title}
LeadTwoNoPicAndTwoSlice,
ListTwoAndSixNoPicSlice,
LeadersSlice,
SecondaryOneSlice,
SecondaryOneAndColumnistSlice,
SecondaryFourSlice,
SecondaryOneAndFourSlice,
SecondaryTwoAndTwoSlice,
SecondaryTwoNoPicAndTwoSlice,
PuzzleSlice,
StandardSlice
} from "../src/slices";
const slices = [
{
mock: mockDailyRegisterSlice(),
name: "daily universal register",
Slice: DailyRegisterLeadFourSlice
},
{
mock: mockLeadOneFullWidthSlice(),
name: "lead one full width",
Slice: LeadOneFullWidthSlice
},
{
mock: mockLeadOneAndOneSlice(),
name: "lead one and one",
Slice: LeadOneAndOneSlice
},
{
mock: mockLeadOneAndFourSlice(),
name: "lead one and four",
TileY,
TileZ,
TileAA,
TileAB,
TileAH,
TileAI,
TileAL,
TileAM,
TileAN,
TileAR,
TileAS,
TileAF
} from "./src/tiles";
const tile = mockEditionSlice(1).items[0];
const dailyRegisterItem = mockDailyRegisterSlice().birthdaysToday;
const preventDefaultedAction = decorateAction =>
decorateAction([
([e, ...args]) => {
e.preventDefault();
return ["[SyntheticEvent (storybook prevented default)]", ...args];
}
]);
const renderTile = (Tile, mockTile = tile) => (_, { decorateAction }) => (
publicationName: select("Publication:", publications, "TIMES"),
savedArticles: select("savedArticles:", savedArticles, null)
}}
>
);
const sliceStories = [
{
mock: mockDailyRegisterSlice(),
name: "Daily Register Lead Four (Mobile, Tablet: S,S,S,S)",
Slice: DailyRegisterLeadFourSlice
},
{
mock: mockLeadOneAndFourSlice(),
name: "Lead One And Four (Mobile: I,J,J,J,J, Tablet: AC,AD,AD,AD,AD)",
Slice: LeadOneAndFourSlice
},
{
mock: mockStandardSlice(),
name: "Standard Slice (K*)",
Slice: StandardSlice
},
{
mock: mockLeadOneAndOneSlice(),
name: "Lead One And One (Mobile: A,B, Tablet: U,C, Wide: U,C, Huge:U,AQ)",