Protractor check if modal closed. browser.waitForAngular
<p>I want to click the cancel button on an angular bootstrap modal. This should close the modal, which it does. I want to test that the modal is no longer visible and I am using the WebElement.isDisplayed() promise. I notice if I do <strong>NOT</strong> use browser.waitForAngular my test will NOT pass. The following code <strong>DOES</strong> work (I have defined my own page objects)</p>

<pre><code>variableExpenseModal.cancel();
browser.waitForAngular();
expect(variableExpenseModal.modalIsDisplayed()).toEqual(false);
</code></pre>

<p>Is this the proper way to test this? Should I use browser.waitForAngular? Or am I missing some way to use promises to do this? Please advise.</p>