EFForg / OpenWireless

The official home of the EFF OpenWireless Project
Other
732 stars 80 forks source link

Use real Mustache templates in spec tests #290

Open jsha opened 9 years ago

jsha commented 9 years ago

Using jasmine-fixture in spec allows changes to the HTML to break the app without causing tests to fail.

Right now our tests use a function called affix that's part of jasmine-fixture in order to generate a dummy HTML page for testing, e.g.

affix('form input#newPassword+input#retypePassword+input#newPasswordError+input#retypePasswordError+input#oldPassword+div#genericError');

Unfortunately that means that we can change the handlebars templates in a breaking way without breaking any tests. Instead, the tests should load the compiled Mustache templates from app/js/templates.js and interpolate them with appropriate values for each test.

r4d1n commented 9 years ago

We are working on this at the hackathon!