Skip to content

Commit

Permalink
docs(guide/directives): improve Protractor test for bindings
Browse files Browse the repository at this point in the history
This needs Protractor >= 1.3.0 to work.

Closes angular#9330
  • Loading branch information
elgalu authored and Narretz committed Jan 26, 2016
1 parent d641901 commit adcfa74
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/content/guide/directive.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ For example, the following forms are all equivalent and match the {@link ngBind}
</file>
<file name="protractor.js" type="protractor">
it('should show off bindings', function() {
expect(element(by.css('div[ng-controller="Controller"] span[ng-bind]')).getText())
.toBe('Max Karl Ernst Ludwig Planck (April 23, 1858 – October 4, 1947)');
var containerElm = element(by.css('div[ng-controller="Controller"]'));
var nameBindings = containerElm.all(by.binding('name'));

expect(nameBindings.count()).toBe(5);
nameBindings.each(function(elem) {
expect(elem.getText()).toEqual('Max Karl Ernst Ludwig Planck (April 23, 1858 – October 4, 1947)');
});
});
</file>
</example>
Expand Down

0 comments on commit adcfa74

Please sign in to comment.