<commit_before>import React from 'react';
import { shallow, mount } from 'enzyme';

import TeacherAccount from '../TeacherAccount.jsx';
import MySubscription from '../../components/subscriptions/my_subscription.jsx';
import SelectSchool from '../../components/accounts/school/select_school';
import LoadingSpinner from '../../components/shared/loading_indicator.jsx';
import ButtonLoadingIndicator from '../../components/shared/button_loading_indicator.jsx';

const subscriptionProps = { subscription: {
  expiration: 'Sat, 09 Mar 2019',
  account_type: 'School Paid', },
  accountTypes: { trial: [], teacher: [], school: [], },
};

describe('TeacherAccount container', () => {
  // Sadly, we have to mount here instead of using shallow
  // because the TeacherAccount container uses quite a few
  // refs for input fields. In order to test these, we need
  // to use mount because shallow does not play with refs.
  const wrapper = mount(
    <TeacherAccount
      userType="teacher"
      teacherId={7}
      subscriptionProps={subscriptionProps}
    />
  );
  const wrapperStaff = mount(
    <TeacherAccount
      userType="staff"
      subscriptionProps={subscriptionProps}
    />
  );
  wrapper.setState({ loading: false, });
  wrapperStaff.setState({ loading: false, });

  it('should have the expected initial state', () => {
    expect(shallow(<TeacherAccount subscriptionProps={subscriptionProps} userType="arbitrary" teacherId={4} />).state()).toEqual({
      id: 4,
      name: '',
      username: '',
      email: '',
      isSaving: false,
      selectedSchool: null,
      originalSelectedSchool: null,
      schoolOptions: [],
      schoolOptionsDoNotApply: false,
      role: 'teacher',<commit_msg>Update Jest Tests<commit_after>import React from 'react';
import { shallow, mount } from 'enzyme';

import TeacherAccount from '../TeacherAccount.jsx';
import MySubscription from '../../components/subscriptions/my_subscription.jsx';
import SelectSchool from '../../components/accounts/school/select_school';
import LoadingSpinner from '../../components/shared/loading_indicator.jsx';
import ButtonLoadingIndicator from '../../components/shared/button_loading_indicator.jsx';

const subscriptionProps = { subscription: {
  expiration: 'Sat, 09 Mar 2019',
  account_type: 'School Paid', },
  accountTypes: { trial: [], teacher: [], school: [], },
};

const timeZones = JSON.parse('[{"name":"Select Time Zone","id":"Select Time Zone"},{"name":"Africa/Abidjan","id":"Africa/Abidjan"},{"name":"Africa/Accra","id":"Africa/Accra"}]');

describe('TeacherAccount container', () => {
  // Sadly, we have to mount here instead of using shallow
  // because the TeacherAccount container uses quite a few
  // refs for input fields. In order to test these, we need
  // to use mount because shallow does not play with refs.
  const wrapper = mount(
    <TeacherAccount
      userType="teacher"
      teacherId={7}
      subscriptionProps={subscriptionProps}
      timeZones={timeZones}
    />
  );
  const wrapperStaff = mount(
    <TeacherAccount
      userType="staff"
      subscriptionProps={subscriptionProps}
      timeZones={timeZones}
    />
  );
  wrapper.setState({ loading: false, });
  wrapperStaff.setState({ loading: false, });

  it('should have the expected initial state', () => {
    expect(shallow(<TeacherAccount subscriptionProps={subscriptionProps} userType="arbitrary" teacherId={4} timeZones={timeZones} />).state()).toEqual({
      id: 4,
      name: '',
      username: '',
      email: '',
      time_zone: 'Select Time Zone',
      isSaving: false,
      selectedSchool: null,
      originalSelectedSchool: null,
      schoolOptions: [],
      schoolOptionsDoNotApply: false,
      role: 'teacher',
{'fraction_non_alphanumeric': 0.1397907163938825, 'fraction_numerical': 0.004829621679635095, 'mean_word_length': 3.8541666666666665, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 13, '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': '4942200', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1039, 'n_words': 277}