-
-
Save tb/ac9e7f2ecbd6830bd2c6f1234076f9ae 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
const setup = propOverrides => { | |
const props = Object.assign({ | |
completedCount: 0, | |
activeCount: 0, | |
onClearCompleted: jest.fn(), | |
}, propOverrides) | |
const wrapper = shallow(<Footer {...props} />) | |
return { | |
props, | |
wrapper, | |
clear: wrapper.find('.clear-completed'), | |
count: wrapper.find('.todo-count'), | |
} | |
} | |
describe('count', () => { | |
test('when active count 0', () => { | |
const { count } = setup({ activeCount: 0 }) | |
expect(count.text()).toEqual('No items left') | |
}) | |
test('when active count above 0', () => { | |
const { count } = setup({ activeCount: 1 }) | |
expect(count.text()).toEqual('1 item left') | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
❤️