Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
{
mock: { puzzles: getPuzzleSlices(3) },
name: "puzzle",
Slice: PuzzleSlice
}
];
const slicesWithPubLogo = [
{
mock: mockSecondaryOneAndFourSlice(),
name: "secondary one and four",
Slice: SecondaryOneAndFourSlice
},
{
mock: mockLeadersSlice(),
name: "leaders",
Slice: LeadersSlice
}
];
jest.mock("@times-components/utils", () => {
// eslint-disable-next-line global-require
const actualUtils = jest.requireActual("@times-components/utils");
return {
...actualUtils,
getDimensions: jest.fn(() => ({ height: 700, width: 500 }))
};
});
const testsWithPublictaion = publicationName =>
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",
Slice: LeadTwoNoPicAndTwoSlice
},
{
mock: mockLeadersSlice(),
name: "leaders slice",
Slice: LeadersSlice
},
{
mock: mockSecondaryOneAndFourSlice(),
name: "secondary one and four",
Slice: SecondaryOneAndFourSlice
},
{
mock: mockSecondaryOneSlice(),
name: "secondary one",
Slice: SecondaryOneSlice
},
{
mock: mockSecondaryFourSlice(),
name: "secondary four",
Slice: SecondaryTwoAndTwoSlice
},
{
mock: mockSecondaryTwoNoPicAndTwoSlice(),
name:
"Secondary Two No Pic And Two (Mobile: B,B,G,G - Tablet: AE,AE,G,G, Wide Tablet/Desktop: AE,AE,AP,AP)",
Slice: SecondaryTwoNoPicAndTwoSlice
},
{
mock: mockListTwoAndSixNoPicSlice(),
name:
"List Two And Six No Pic (Mobile: : C,C,L,L,L,L,L,L, Tablet: AQ,AQ,L,L,L,L,L,L, Wide Tablet: C,C,L,L,L,L,L,L)",
Slice: ListTwoAndSixNoPicSlice
},
{
mock: mockLeadersSlice(),
name: "Leaders (Mobile: M,M,M,M, Tablet: AG,AG,AG,AG)",
Slice: LeadersSlice
},
{
mock: mockCommentLeadAndCartoonSlice(),
name: "Comment Lead And Cartoon (Mobile: P,Q, Tablet: AH, AI)",
Slice: CommentLeadAndCartoonSlice
}
];
export default {
children: sliceStories.map(({ mock, name, Slice }) => ({
component: renderSlice(Slice, mock),
name,
type: "story"
})),