<commit_before>import { mount } from "enzyme"
import "jest-styled-components"
import React from "react"
import { FeatureArticle, SeriesArticle } from "../../Fixtures/Articles"
import { RelatedCanvas } from "../../Fixtures/Components"
import { RelatedArticlesCanvas } from "../../RelatedArticles/RelatedArticlesCanvas"
import { FeatureLayout } from "../FeatureLayout"
import { Nav } from "../../Nav/Nav"

jest.mock("react-sizeme", () => jest.fn(c => d => d))
jest.mock("../../Sections/FullscreenViewer/withFullScreen", () => ({
  withFullScreen: x => x,
}))

it("renders RelatedArticlesCanvas", () => {
  const article = mount(
    <FeatureLayout
      article={FeatureArticle}
      relatedArticlesForCanvas={RelatedCanvas}
    />
  )
  expect(article.find(RelatedArticlesCanvas).length).toBe(1)
})

it("Does not render RelatedArticlesCanvas if isSuper", () => {
  const article = mount(
    <FeatureLayout
      article={FeatureArticle}
      relatedArticlesForCanvas={RelatedCanvas}
      isSuper
    />
  )
  expect(article.find(RelatedArticlesCanvas).length).toBe(0)
})

it("renders a nav if article is in a series", () => {
  const article = mount(
    <FeatureLayout
      article={FeatureArticle}
      relatedArticlesForCanvas={RelatedCanvas}
      seriesArticle={SeriesArticle}
    />
  )
  expect(article.find(Nav).length).toBe(1)
})<commit_msg>Add one more test for non-fullscreen heders<commit_after>import { mount } from "enzyme"
import "jest-styled-components"
import React from "react"
import { cloneDeep, extend } from "lodash"
import { FeatureArticle, SeriesArticle } from "../../Fixtures/Articles"
import { RelatedCanvas } from "../../Fixtures/Components"
import { RelatedArticlesCanvas } from "../../RelatedArticles/RelatedArticlesCanvas"
import { FeatureLayout } from "../FeatureLayout"
import { Nav } from "../../Nav/Nav"

jest.mock("react-sizeme", () => jest.fn(c => d => d))
jest.mock("../../Sections/FullscreenViewer/withFullScreen", () => ({
  withFullScreen: x => x,
}))

it("renders RelatedArticlesCanvas", () => {
  const article = mount(
    <FeatureLayout
      article={FeatureArticle}
      relatedArticlesForCanvas={RelatedCanvas}
    />
  )
  expect(article.find(RelatedArticlesCanvas).length).toBe(1)
})

it("Does not render RelatedArticlesCanvas if isSuper", () => {
  const article = mount(
    <FeatureLayout
      article={FeatureArticle}
      relatedArticlesForCanvas={RelatedCanvas}
      isSuper
    />
  )
  expect(article.find(RelatedArticlesCanvas).length).toBe(0)
})

it("renders a nav if article is in a series", () => {
  const article = mount(
    <FeatureLayout
      article={FeatureArticle}
      relatedArticlesForCanvas={RelatedCanvas}
      seriesArticle={SeriesArticle}
    />
  )
  expect(article.find(Nav).length).toBe(1)
})

it("does not render a nav if article has a non-fullscreen header", () => {
  const Article = extend(cloneDeep(FeatureArticle), {
    hero_section: {
      type: "basic",
    },
  })
  const article = mount(
    <FeatureLayout
      article={Article}
      relatedArticlesForCanvas={RelatedCanvas}
      seriesArticle={SeriesArticle}
    />
  )
  expect(article.find(Nav).length).toBe(0)
})
{'fraction_non_alphanumeric': 0.14933837429111532, 'fraction_numerical': 0.002205419029615627, 'mean_word_length': 3.8547400611620795, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2561296', 'n_tokens_mistral': 965, 'n_tokens_neox': 930, 'n_words': 194}