How to use the @times-components/provider-test-tools.fixtures.keyFacts function in @times-components/provider-test-tools

To help you get started, we’ve selected a few @times-components/provider-test-tools 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 / article / showcase-helper.js View on Github external
const makeArticle = configuration => article => {
  const configuredArticle = { ...article };
  const extraContent = [];

  if (!(configuration & FLAGS)) {
    configuredArticle.expirableFlags = [];
  }

  if (!(configuration & HEADLINE)) {
    configuredArticle.headline = null;
  }

  if (configuration & KEY_FACTS) {
    configuredArticle.content = [
      ...configuredArticle.content.slice(0, 2),
      fixtures.keyFacts,
      ...configuredArticle.content.slice(2)
    ];
  }

  if (!(configuration & LABEL)) {
    configuredArticle.label = null;
  }

  if (!(configuration & LEAD_ASSET)) {
    configuredArticle.leadAsset = null;
  }

  if (configuration & LINKED_BYLINE) {
    configuredArticle.bylines = fixtures.bylineWithLink;
  }