Testing the DOM
In this recipe, you will learn a technique to quickly test weather the DOM or the web page itself is what it is supposed to be, even when the Vue component is not present in the page.
Getting ready
For this recipe, you should have a test setup already up and working; complete the Using Jasmine for testing Vue recipe if you don't know what that means.
I will assume that you have Jasmine installed and you can perform tests. Basically, all you need is a web page (JSFiddle is okay) and these four dependencies installed:
jasmine.css
jasmine.js
jasmine-html.js
boot.js
If you are using JSFiddle or adding them manually, remember to add them in the specified order. Find the link to these files in the Using Jasmine for testing Vue recipe.
How to do it...
Let's suppose that you are writing a component that displays the Hello World!
greeting; you want to test that the greeting is actually displayed, but the web page you are testing is already complex enough and you want to test your component...