For testing these new form fields and their combined behavior, we will use the test file in test/todos.js
, and augment the Todo creation form
scope:
First we test that these radio buttons do exist and that the alarms are turned off by default:
it('should not present the alarm date form fields when no alarm is selected', login(function(browser, done) { browser.visit('http://localhost:3000/todos/new', function(err) { if (err) throw err; browser.choose('No Alarm', function(err) { if (err) throw err; assert.equal(browser.query('#alarm-date-time').style.display, 'none'); done(); }); }); }) );
Here we're verifying that we actually have two radio buttons for the
alarm
field, one having afalse
and the other having atrue
string value. Then we also verify that the first one is checked.We also need to verify that the animation of the new date and time form fields works; the
div
element that wraps the alarm date...