angular-training-slides icon indicating copy to clipboard operation
angular-training-slides copied to clipboard

/unit-testing-creating-and-injecting-mock-object-3: Test that the observable is returned, don’t use the side effect.

Open jamesbs opened this issue 7 years ago • 2 comments

jamesbs avatar Apr 18 '17 02:04 jamesbs

Changing this test case and subsequently slide 139 (#370) will mean that other areas of the training app will need to be updated, specifically the addItem and deleteItem methods, as well as tests and verifying that the content still remains consistent.

We'd have to bring in a BehaviorSubject and either keep a copy of state for the filtering (deleting), or do more advanced observable magic to avoid state

This is fine... (this issue is no longer "small" now), however it's worth answering the question of how much we want to throw at the students.

I vote keeping the naive simple case here. In which case this issue is a noop

cc: @gvwilson

rpdasilva avatar Apr 25 '17 16:04 rpdasilva

@rpdasilva let's review these issues on Monday in light of the changes in PR #496. I simplified the tested code a lot and while I based it on Greg's new example repo, I tried to keep it generic.

mdegani avatar May 04 '17 17:05 mdegani