angular-training-slides
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.
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 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.