Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions examples/todomvc/components/MainSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ class MainSection extends Component {
}

handleClearCompleted() {
const atLeastOneCompleted = this.props.todos.some(todo => todo.completed)
if (atLeastOneCompleted) {
this.props.actions.clearCompleted()
}
this.props.actions.clearCompleted()
}

handleShow(filter) {
Expand Down
15 changes: 0 additions & 15 deletions examples/todomvc/test/components/MainSection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,6 @@ describe('components', () => {
footer.props.onClearCompleted()
expect(props.actions.clearCompleted).toHaveBeenCalled()
})

it('onClearCompleted shouldnt call clearCompleted if no todos completed', () => {
const { output, props } = setup({
todos: [
{
text: 'Use Redux',
completed: false,
id: 0
}
]
})
const [ , , footer ] = output.props.children
footer.props.onClearCompleted()
expect(props.actions.clearCompleted.calls.length).toBe(0)
})
})

describe('todo list', () => {
Expand Down