Skip to content

Instantly share code, notes, and snippets.

@artberri
Created May 28, 2019 18:00
Show Gist options
  • Save artberri/c6e9ecce7a402c6297b0d151b5e335b2 to your computer and use it in GitHub Desktop.
Save artberri/c6e9ecce7a402c6297b0d151b5e335b2 to your computer and use it in GitHub Desktop.
// ...
describe('On toggle checkbox clicked', () => {
describe('when it is initially active', () => {
beforeEach(() => {
view.todo = activeTodo;
presenter.attach(view);
jest.clearAllMocks();
});
test('completes the todo', () => {
presenter.toggleTodo();
expect(todosState.state[0].isCompleted).toBe(true);
});
test('checks the checkbox', () => {
presenter.toggleTodo();
expect(view.completeTodo).toHaveBeenCalled();
});
});
});
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment