Skip to content

Instantly share code, notes, and snippets.

@lydemann
Last active June 18, 2019 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lydemann/29774f0dbd40af01e06004fa40790c71 to your computer and use it in GitHub Desktop.
Save lydemann/29774f0dbd40af01e06004fa40790c71 to your computer and use it in GitHub Desktop.
todo-list-sandbox.service.spec.ts
describe('saveTodoItem', () => {
it('should create todo', () => {
const todoItem = new TODOItem('', '');
todoListResourcesServiceStub.addTodo.and.returnValue(of(todoItem));
service
.saveTodoItem(todoItem)
.pipe(first())
.subscribe(() => {});
expect(store.dispatch).toHaveBeenCalledWith(new SaveTodoItemStartedAction());
expect(store.dispatch).toHaveBeenCalledWith(new AddTodoItemSuccessAction(todoItem));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment