Skip to content

Commit

Permalink
test(clear): show that clear() now works and updates the model
Browse files Browse the repository at this point in the history
Closes #301
  • Loading branch information
juliemr committed Mar 27, 2014
1 parent f3cf535 commit b93c831
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions spec/basic/findelements_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ describe('locators', function() {
describe('by model', function() {
it('should find an element by text input model', function() {
var username = element(by.model('username'));
username.clear();
username.sendKeys('Jane Doe');

var name = element(by.binding('username'));

username.clear();
expect(name.getText()).toEqual('');

username.sendKeys('Jane Doe');
expect(name.getText()).toEqual('Jane Doe');
});

Expand Down Expand Up @@ -104,6 +105,20 @@ describe('locators', function() {
expect(arr.length).toEqual(3);
});
});

it('should clear text from an input model', function() {
var username = element(by.model('username'));
var name = element(by.binding('username'));

username.clear();
expect(name.getText()).toEqual('');

username.sendKeys('Jane Doe');
expect(name.getText()).toEqual('Jane Doe');

username.clear();
expect(name.getText()).toEqual('');
});
});

describe('by select', function() {
Expand Down

0 comments on commit b93c831

Please sign in to comment.