How to use the @times-components/fixture-generator.mockDailyRegisterSlice function in @times-components/fixture-generator

To help you get started, we’ve selected a few @times-components/fixture-generator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newsuk / times-components / packages / edition-slices / __tests__ / shared-tablet-slices.base.js View on Github external
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",
github newsuk / times-components / packages / edition-slices / __tests__ / shared-tiles.base.js View on Github external
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}
github newsuk / times-components / packages / edition-slices / __tests__ / shared-slices.base.js View on Github external
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",
github newsuk / times-components / packages / edition-slices / edition-tiles.showcase.js View on Github external
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 }) => (
github newsuk / times-components / packages / edition-slices / edition-slices.showcase.js View on Github external
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)",