/* global describe, before, after, it */
'use strict';

describe('#/notes/add', function() {
    before(function(client, done) {
        done();
    });

    after(function(client, done) {
        client.end(function() {
            done();
        });
    });

    it('can change note title', function(client) {
        client.urlHash('notes/add')
        .expect.element('#editor--input--title').to.be.visible.before(50000);

        client.setValue('#editor--input--title', ['Nightwatch', client.keys.ENTER])
        .pause(1000)
        .expect.element('#editor--input--title').value.to.contain('Nightwatch');
    });

});

@@ -477,21 +477,16 @@
  %5B'Night
-watch
 ', clien
@@ -517,94 +517,1910 @@
 paus
+e(1000)%0A        .expect.element('#editor--input--title').value.to.contain('Night');%0A    %7D);%0A%0A    it('shows confirm dialog if title is not empty', function(client) %7B%0A        client%0A        .setValue('#editor--input--title', %5B' Watch', client.keys.ENTER%5D)%0A        .click('.editor--cancel')%0A        .expect.element('.modal-dialog').to.be.visible.befor
 e(1000)
+;
 %0A    
-    .expect.element('#editor--input--title').value.to.contain('Nightwatch'
+%7D);%0A%0A    it('hides confirm dialog on %22Esc%22', function(client) %7B%0A        client%0A        .keys(%5Bclient.Keys.ESCAPE%5D)%0A        .waitForElementNotPresent('.modal-dialog', 1000);%0A    %7D);%0A%0A    it('closes the form if title is empty', function(client) %7B%0A        client%0A        .clearValue('#editor--input--title')%0A        .click('.editor--cancel')%0A        .waitForElementNotPresent('.layout--body.-form', 1000);%0A    %7D);%0A%0A    it('shows notebook add form', function(client) %7B%0A        client%0A        .click('.addNotebook')%0A        .expect.element('.modal--input%5Bname=name%5D').to.be.visible.before(1000);%0A    %7D);%0A%0A    it('makes a new notebook active', function(client) %7B%0A        client%0A        .setValue('.modal--input%5Bname=name%5D', %5B'Nightwatch', client.keys.ENTER%5D)%0A        .keys(%5Bclient.Keys.ENTER%5D)%0A        .pause(1000)%0A        .perform(function(client, done) %7B%0A            client.getValue('%5Bname=%22notebookId%22%5D', function(res) %7B%0A                client.assert.containsText('option%5Bvalue=%22' + res.value + '%22%5D', 'Nightwatch');%0A                done();%0A            %7D);%0A        %7D);%0A    %7D);%0A%0A    it('switches into fullscreen mode', function(client) %7B%0A        client.expect.element('a%5Bdata-mode=%22fullscreen%22%5D').to.be.present.before(1000);%0A%0A        client%0A        .click('button%5Btitle=%22Mode%22%5D')%0A        .click('a%5Bdata-mode=%22fullscreen%22%5D')%0A        .expect.element('body').to.have.attribute('class').which.does.not.contain('-preview').before(2000);%0A%0A        client.expect.element('body').to.have.attribute('class').which.contains('editor--fullscreen').before(2000
 );%0A 

Add UI tests for note form