Closed eliasre closed 8 years ago
Hi @eliasre . Have you been able to resolve this issue? The logic in the plugin is very simple: it it matches a request, then return the mock. If not, then do the $http call as normal. This is to potentially handle hybrid scenarios were you do not need to mock everything.
Could you provide some more information on the calls that are being made? For instance, what calls are you expecting to match vs the calls that are actually requested by the app?
Looks like my problem (logically), was 401s being returned (by backend) whenever the app requested something not intercepted by the mock. Silly mistake on my part.
First, I'd like to say thanks to the devs of protractor-http-mock. Easy and intuitive:)
The app I am (helping) develop has a backend that I can run locally (and I usually do during development). The webapp will attempt to check authentication against the backend on initialization and will receive a 401 if it is not authenticated (in which case a modal will be displayed asking the user to log in).
If my backend is not running, everything seems to work like a charm. The auth-request is intercepted by protractor-http-mock and mock data is returned.
When my backend is running my first test as expected, but in proceeding tests, the login-modal appears. It looks like the response is actually passed through to the backend and the response is cached by angular (my guess). I'm having trouble debugging this in the browser but can post (some) code and can follow instructions if you need more info. The appearing modal is a potential issue as it can interfere with clicking if it overlaps any targets on the webpage.