Elementthat is dynamically added to the DOM with
flushafter appending your Component to the
document. This means that you should clean up the
documentjust before each test finishes, ensuring that you leave the document in the same state it was before conducting this very test. This may imply the following:
document.body, remember to
setTimeout: Tests are (generally) performed really fast, completing and quitting well before a delayed function is called. Of course, you can wait for the delayed function to be called in your test code, but remember that tests are supposed to be run frequently, and the additional delay could accummulate to a considerable waste of time. Therefore, I would generally warn against using
@polymer/app-route, which interacts with the URL. This can be really tricky, as the URL of the testing
documentis probably some random HTML file. I still have not yet found a nice way to test routing behaviors.
karma_web_test_suite?) will execute tests in some
'/context.html'(this will be your
window.location.pathname). This will make testing
PaperListboxElement.selectis not a function in Jasmine?!
document.body-- I suppose using fixture will make this problem go away. Methods tried and didn't work for selecting an item in a