<commit_before>import { cloneDeep } from "lodash"
import { FeatureArticle } from "@artsy/reaction/dist/Components/Publishing/Fixtures/Articles"
import Backbone from "backbone"
import {
  changeArticleData,
  changeSavedStatus,
  deleteArticle,
  onAddFeaturedItem,
  onFirstSave,
  onChangeArticle,
  publishArticle,
  saveArticle,
  setMentionedItems,
  setSeoKeyword,
} from "client/actions/edit/articleActions"
import Article from "client/models/article.coffee"

describe("articleActions", () => {
  let article

  beforeEach(() => {
    window.location.assign = jest.fn()
    article = cloneDeep(FeatureArticle)
  })

  document.body.innerHTML = `
    <div>
      <input id="focus-keyword" value="ceramics" />
    </div>'
  `

  describe("#changeArticleData", () => {
    let getState
    let dispatch

    beforeEach(() => {
      getState = jest.fn(() => ({
        edit: { article },
      }))
      dispatch = jest.fn()
    })

    it("Calls #changeArticle", () => {
      changeArticleData("title", "Title")(dispatch, getState)
      expect(dispatch.mock.calls[0][0].type).toBe("CHANGE_ARTICLE")
    })

    it("Can accept a key/value pair as args", () => {
      changeArticleData("title", "Title")(dispatch, getState)
      expect(dispatch.mock.calls[0][0].payload.data.title).toBe("Title")
    })

    it("Can accept a key/value pair with nested object as args", () => {<commit_msg>removed unecessary lines from article actions tests<commit_after>import { cloneDeep } from "lodash"
import { FeatureArticle } from "@artsy/reaction/dist/Components/Publishing/Fixtures/Articles"
import Backbone from "backbone"
import {
  changeArticleData,
  changeSavedStatus,
  deleteArticle,
  onAddFeaturedItem,
  onFirstSave,
  onChangeArticle,
  publishArticle,
  saveArticle,
  setMentionedItems,
  setSeoKeyword,
} from "client/actions/edit/articleActions"
import Article from "client/models/article.coffee"

describe("articleActions", () => {
  let article

  beforeEach(() => {
    window.location.assign = jest.fn()
    article = cloneDeep(FeatureArticle)
  })

  describe("#changeArticleData", () => {
    let getState
    let dispatch

    beforeEach(() => {
      getState = jest.fn(() => ({
        edit: { article },
      }))
      dispatch = jest.fn()
    })

    it("Calls #changeArticle", () => {
      changeArticleData("title", "Title")(dispatch, getState)
      expect(dispatch.mock.calls[0][0].type).toBe("CHANGE_ARTICLE")
    })

    it("Can accept a key/value pair as args", () => {
      changeArticleData("title", "Title")(dispatch, getState)
      expect(dispatch.mock.calls[0][0].payload.data.title).toBe("Title")
    })

    it("Can accept a key/value pair with nested object as args", () => {
{'fraction_non_alphanumeric': 0.14758925285241076, 'fraction_numerical': 0.002944423997055576, 'mean_word_length': 3.6620926243567755, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 22, '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': '3949679', 'n_tokens_mistral': 871, 'n_tokens_neox': 833, 'n_words': 164}