-
-
Save tb/f53ea186bb34b102d4fe1c81a13e4fba 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('todo list', () => { | |
const testFilteredTodos = (filter, todos) => { | |
test(`render ${filter} items`, () => { | |
const { wrapper, footer } = setup() | |
footer.props().onShow(filter) | |
expect(wrapper.find(TodoItem).map(node => node.props().todo)).toEqual(todos) | |
}) | |
} | |
testFilteredTodos(SHOW_ALL, todos) | |
testFilteredTodos(SHOW_ACTIVE, [todos[0]]) | |
testFilteredTodos(SHOW_COMPLETED, [todos[1]]) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment