I think MockInventoryService is not necessary here. You can make a spy without it.
Your tests would do just fine, if you use the real service, but using the spyOn()'s .and.returnValue() method, or any other of spyOn()'s methods, to make the spy do what you need for your test.
That would save you a lot of lines of code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think
MockInventoryService
is not necessary here. You can make a spy without it.Your tests would do just fine, if you use the real service, but using the
spyOn()
's.and.returnValue()
method, or any other ofspyOn()
's methods, to make the spy do what you need for your test.That would save you a lot of lines of code.