Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8cd9848

Browse files
docs(ngMessageFormat): fix e2e test in example
1 parent b7f786e commit 8cd9848

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/ngMessageFormat/messageFormatService.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@
7676
* <example name="ngMessageFormat-example-plural" module="msgFmtExample" deps="angular-message-format.js">
7777
* <file name="index.html">
7878
* <div ng-controller="AppController">
79-
Select recipients:<br>
80-
<select multiple size=5 ng-model="recipients" ng-options="person as person.name for person in people">
81-
</select><br>
79+
* <button ng-click="recipients.pop()" id="decreaseRecipients">decreaseRecipients</button><br>
80+
* Select recipients:<br>
81+
* <select multiple size=5 ng-model="recipients" ng-options="person as person.name for person in people">
82+
* </select><br>
8283
* <p>{{recipients.length, plural, offset:1
8384
* =0 {{{sender.name}} gave no gifts (\#=#)}
8485
* =1 {{{sender.name}} gave a gift to {{recipients[0].name}} (\#=#)}
@@ -110,27 +111,17 @@
110111
*
111112
* <file name="protractor.js" type="protractor">
112113
* describe('MessageFormat plural', function() {
113-
* function clickOptionCtrl(select, index) {
114-
* element.all(by.css('select option')).then(function(arr) {
115-
browser.actions()
116-
.mouseMove(arr[index])
117-
.keyDown(protractor.Key.CONTROL)
118-
.click()
119-
.keyUp(protractor.Key.CONTROL)
120-
.perform();
121-
});
122-
* }
123114
*
124115
* it('should pluralize initial values', function() {
125116
* var messageElem = element(by.binding('recipients.length')),
126-
* select = element(by.css('select'));
117+
* decreaseRecipientsBtn = element(by.id('decreaseRecipients'));
127118
*
128119
* expect(messageElem.getText()).toEqual('Harry Potter gave Alice and 2 other people a gift (#=2)');
129-
clickOptionCtrl(select, 2);
120+
* decreaseRecipientsBtn.click();
130121
* expect(messageElem.getText()).toEqual('Harry Potter gave Alice and one other person a gift (#=1)');
131-
clickOptionCtrl(select, 1);
122+
* decreaseRecipientsBtn.click();
132123
* expect(messageElem.getText()).toEqual('Harry Potter gave a gift to Alice (#=0)');
133-
clickOptionCtrl(select, 0);
124+
* decreaseRecipientsBtn.click();
134125
* expect(messageElem.getText()).toEqual('Harry Potter gave no gifts (#=-1)');
135126
* });
136127
* });

0 commit comments

Comments
 (0)