Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock on response doesn't work #420

Open
bastien-m opened this issue Jan 11, 2018 · 0 comments
Open

Mock on response doesn't work #420

bastien-m opened this issue Jan 11, 2018 · 0 comments

Comments

@bastien-m
Copy link

IMPORTANT: Please provide a sample using: http://plnkr.co/edit/lV7zsw7Yqossgs9JOfQU?p=preview

  • I'm submitting a ...
    [x ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository

  • What is the current behavior?
    When I try to mock the open function, the real implementation get called during the unit test phase.
    So the code inside the "then(response => {...})" is never reached because there is no response back from the modal.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    https://github.com/bastien-m/ngx-modialog-test

You can reproduce what I'm trying to explain by cloning the repository above.

  • What is the expected behavior?
    I expect the unit test to call the mock function instead of the real implementation

  • Please tell us about your environment:

Everything is inside the package.json. The project was generated by angular/cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant