<commit_before>/* global SETTINGS:false */
/* eslint-disable no-unused-vars */
import React from "react"
import { assert } from "chai"
import _ from "lodash"
import ReactTestUtils from "react-dom/test-utils"
import { render } from "enzyme"
import { Provider } from "react-redux"
import sinon from "sinon"

import * as inputUtil from "../components/inputs/util"
import FinancialAidCalculator, {
  CALCULATOR_DIALOG
} from "../containers/FinancialAidCalculator"
import IntegrationTestHelper from "../util/integration_test_helper"
import {
  modifyTextField,
  modifySelectField,
  clearSelectField
} from "../util/test_utils"
import {
  DASHBOARD_RESPONSE,
  FINANCIAL_AID_PARTIAL_RESPONSE,
  PROGRAMS
} from "../test_constants"
import {
  requestAddFinancialAid,
  requestSkipFinancialAid,
  START_CALCULATOR_EDIT,
  UPDATE_CALCULATOR_EDIT,
  CLEAR_CALCULATOR_EDIT,
  UPDATE_CALCULATOR_VALIDATION,
  REQUEST_SKIP_FINANCIAL_AID,
  RECEIVE_SKIP_FINANCIAL_AID_SUCCESS,
  REQUEST_ADD_FINANCIAL_AID,
  RECEIVE_ADD_FINANCIAL_AID_SUCCESS,
  RECEIVE_ADD_FINANCIAL_AID_FAILURE
} from "../actions/financial_aid"
import {
  receiveGetProgramEnrollmentsSuccess,
  setCurrentProgramEnrollment
} from "../actions/programs"
import {
  setConfirmSkipDialogVisibility,
  SHOW_DIALOG,
  HIDE_DIALOG,
  SET_CONFIRM_SKIP_DIALOG_VISIBILITY
} from "../actions/ui"
import {
  REQUEST_DASHBOARD,
  RECEIVE_DASHBOARD_SUCCESS
} from "../actions/dashboard"
import { DASHBOARD_SUCCESS_ACTIONS } from "./test_util"
import { actions } from "../lib/redux_rest"

describe("FinancialAidCalculator", () => {
  let listenForActions, renderComponent, helper
  const financialAidDashboard = _.cloneDeep(DASHBOARD_RESPONSE)
  const program = financialAidDashboard.programs.find(
    program => program.title === "Not passed program"
  )
  program.financial_aid_availability = true
  program.financial_aid_user_info = {
    max_possible_cost: 100,
    min_possible_cost: 50,
    has_user_applied:  false
  }

  beforeEach(() => {
    helper = new IntegrationTestHelper()
    listenForActions = helper.listenForActions.bind(helper)
    renderComponent = helper.renderComponent.bind(helper)
    helper.dashboardStub.returns(Promise.resolve(financialAidDashboard))
  })
<commit_msg>Increase timeout for FinancialAidCalculator tests (#4833)<commit_after>/* global SETTINGS:false */
/* eslint-disable no-unused-vars */
import React from "react"
import { assert } from "chai"
import _ from "lodash"
import ReactTestUtils from "react-dom/test-utils"
import { render } from "enzyme"
import { Provider } from "react-redux"
import sinon from "sinon"

import * as inputUtil from "../components/inputs/util"
import FinancialAidCalculator, {
  CALCULATOR_DIALOG
} from "../containers/FinancialAidCalculator"
import IntegrationTestHelper from "../util/integration_test_helper"
import {
  modifyTextField,
  modifySelectField,
  clearSelectField
} from "../util/test_utils"
import {
  DASHBOARD_RESPONSE,
  FINANCIAL_AID_PARTIAL_RESPONSE,
  PROGRAMS
} from "../test_constants"
import {
  requestAddFinancialAid,
  requestSkipFinancialAid,
  START_CALCULATOR_EDIT,
  UPDATE_CALCULATOR_EDIT,
  CLEAR_CALCULATOR_EDIT,
  UPDATE_CALCULATOR_VALIDATION,
  REQUEST_SKIP_FINANCIAL_AID,
  RECEIVE_SKIP_FINANCIAL_AID_SUCCESS,
  REQUEST_ADD_FINANCIAL_AID,
  RECEIVE_ADD_FINANCIAL_AID_SUCCESS,
  RECEIVE_ADD_FINANCIAL_AID_FAILURE
} from "../actions/financial_aid"
import {
  receiveGetProgramEnrollmentsSuccess,
  setCurrentProgramEnrollment
} from "../actions/programs"
import {
  setConfirmSkipDialogVisibility,
  SHOW_DIALOG,
  HIDE_DIALOG,
  SET_CONFIRM_SKIP_DIALOG_VISIBILITY
} from "../actions/ui"
import {
  REQUEST_DASHBOARD,
  RECEIVE_DASHBOARD_SUCCESS
} from "../actions/dashboard"
import { DASHBOARD_SUCCESS_ACTIONS } from "./test_util"
import { actions } from "../lib/redux_rest"

describe("FinancialAidCalculator", function() {
  this.timeout(5000)

  let listenForActions, renderComponent, helper
  const financialAidDashboard = _.cloneDeep(DASHBOARD_RESPONSE)
  const program = financialAidDashboard.programs.find(
    program => program.title === "Not passed program"
  )
  program.financial_aid_availability = true
  program.financial_aid_user_info = {
    max_possible_cost: 100,
    min_possible_cost: 50,
    has_user_applied:  false
  }

  beforeEach(() => {
    helper = new IntegrationTestHelper()
    listenForActions = helper.listenForActions.bind(helper)
    renderComponent = helper.renderComponent.bind(helper)
    helper.dashboardStub.returns(Promise.resolve(financialAidDashboard))
  })

{'fraction_non_alphanumeric': 0.09276764123983293, 'fraction_numerical': 0.003956913607386239, 'mean_word_length': 5.408450704225352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6883481', 'n_tokens_mistral': 1597, 'n_tokens_neox': 1532, 'n_words': 269}