-
-
Save tb/41450c6f423c943fef267eb1660ad893 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('clear button', () => { | |
test('no clear button when no completed todos', () => { | |
const { clear } = setup({ completedCount: 0 }) | |
expect(clear.exists()).toBe(false) | |
}) | |
test('on click calls onClearCompleted', () => { | |
const { clear, props } = setup({ completedCount: 1 }) | |
expect(clear.text()).toEqual('Clear completed') | |
clear.simulate('click') | |
expect(props.onClearCompleted).toBeCalledWith() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment