How to use the @times-components/fixture-generator.MockEdition 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 / section / __tests__ / shared-tracking.js View on Github external
it("Save/Unsave article click tracking", () => {
    const edition = new MockEdition().get();
    const stream = jest.fn();
    const onArticlePress = jest.fn();
    const artickleId = edition.sections[0].slices[0].lead.article.id;
    const savedArticles = { artickleId: undefined };
    const onArticleSavePress = () => {
      savedArticles[artickleId] = !savedArticles[artickleId];
    };

    const testInstance = TestRenderer.create(
      
         {}}
          section={edition.sections[0]}
          stream={stream}
        />
github newsuk / times-components / packages / section / __tests__ / shared.js View on Github external
it("should render Secondary 2 No Pic and 2 instead of Secondary 2 and 2 for tablet", () => {
    const edition = new MockEdition().get();

    expect(
      TestRenderer.create(
        <section> {}}
          onArticlePress={() =&gt; {}}
          onPuzzleBarPress={() =&gt; {}}
          onPuzzlePress={() =&gt; {}}
          publicationName="TIMES"
          recentlyOpenedPuzzleCount={1}
          section={edition.sections[5]}
        /&gt;
      ).toJSON()
    ).toMatchSnapshot();
  });
</section>