Skip to content

Instantly share code, notes, and snippets.

@tb
Created March 3, 2017 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tb/f53ea186bb34b102d4fe1c81a13e4fba to your computer and use it in GitHub Desktop.
Save tb/f53ea186bb34b102d4fe1c81a13e4fba to your computer and use it in GitHub Desktop.
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