Skip to content

Commit

Permalink
remove unused state init
Browse files Browse the repository at this point in the history
  • Loading branch information
javaer.ljw committed Apr 17, 2019
1 parent 7221f00 commit f83e49f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion demo/StepsDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ class Demo extends React.Component {
};

this.changeSteps = this.changeSteps.bind(this);
this.onIncrease = this.onIncrease.bind(this);
}

onIncrease = () => {
onIncrease() {
this.setState({
extraSteps: [...this.state.extraSteps, { title: `步骤${this.state.extraSteps.length}`, desc: Math.random().toString(26).slice(2) }],
});
Expand Down
3 changes: 2 additions & 1 deletion tests/Steps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('Steps', () => {
it('initialized state', (done) => {
const i = generateSteps().instance();
i.render();
expect(i.state.init).to.be(false);
// unused state init
// expect(i.state.init).to.be(false);
expect(i.state.tailWidth).to.be(0);
setTimeout(() => {
expect(i.props.children).to.be.an('array');
Expand Down

0 comments on commit f83e49f

Please sign in to comment.