<commit_before>// npm run test-unit './src/components/steps/test/Steps.test.js'

/**
 * Menu test
 * @author yanwei
 */

import React from 'react';
import { shallow, mount } from 'enzyme';
import { expect } from 'chai';
import sinon from 'sinon';
import Steps from '../Steps';
import styles from '../Steps.css';
const Step = Steps.Step;

describe('steps-test-describe----------', () => {
  it('calls componentDidMount', () => {
    sinon.spy(Steps.prototype, 'componentDidMount');
    const app = mount(<Steps>
      <Step title="步骤1" description="这是一段很长很长很长的描述性文字" status="finish" />
      <Step title="步骤2" description="这是一段很长很长很长的描述性文字" status="process" />
      <Step title="步骤3" status="wait" />
      <Step title="步骤4" />
    </Steps>);
    expect(Steps.prototype.componentDidMount.calledOnce).to.equal(true);
  })

  it('calls componentDidUpdate', () => {
    const spy = sinon.spy(Steps.prototype, 'componentDidUpdate');
    const MyCom = () => <Step title="步骤1" />;
    const app = mount(<Steps><commit_msg> change steps test<commit_after>// npm run test-unit './src/components/steps/test/Steps.test.js'

/**
 * Menu test
 * @author yanwei
 */

import React from 'react';
import { shallow, mount, unmount } from 'enzyme';
import { expect } from 'chai';
import sinon from 'sinon';
import Steps from '../Steps';
import styles from '../Steps.css';
const Step = Steps.Step;

describe('steps-test-describe----------', () => {
  it('calls componentDidMount', () => {
    const spy = sinon.spy(Steps.prototype, 'componentDidMount');
    const spyUnmount = sinon.spy(Steps.prototype, 'componentWillUnmount');
    const app = mount(<Steps>
      <Step title="步骤1" description="这是一段很长很长很长的描述性文字" status="finish" />
      <Step title="步骤2" description="这是一段很长很长很长的描述性文字" status="process" />
      <Step title="步骤3" status="wait" />
      <Step title="步骤4" />
    </Steps>);
    expect(spy.calledOnce).to.equal(true);
    app.unmount();
    expect(spyUnmount.calledOnce).to.equal(true);
  });

  it('calls componentDidUpdate', () => {
    const spy = sinon.spy(Steps.prototype, 'componentDidUpdate');
    const MyCom = () => <Step title="步骤1" />;
    const app = mount(<Steps>
{'fraction_non_alphanumeric': 0.18407731247123793, 'fraction_numerical': 0.004601932811780948, 'mean_word_length': 3.715835140997831, 'pattern_counts': {'":': 0, '<': 19, '<?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': '7306665', 'n_tokens_mistral': 791, 'n_tokens_neox': 800, 'n_words': 157}