Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.