X Tutup
Skip to content

Commit 896e346

Browse files
docs(NgModelController): don't run contenteditable example on FF
1 parent 0b28de1 commit 896e346

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/ng/directive/input.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -956,23 +956,22 @@ var VALID_CLASS = 'ng-valid',
956956
</form>
957957
</file>
958958
<file name="protractor.js" type="protractor">
959-
it('should data-bind and become invalid', function() {
960-
if (browser.params.browser == 'safari') {
961-
// SafariDriver can't handle contenteditable.
962-
return;
963-
}
964-
var contentEditable = element(by.css('[contenteditable]'));
965-
966-
expect(contentEditable.getText()).toEqual('Change me!');
959+
it('should data-bind and become invalid', function() {
960+
if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') {
961+
// SafariDriver can't handle contenteditable
962+
// and Firefox driver can't clear contenteditables very well
963+
return;
964+
}
965+
var contentEditable = element(by.css('[contenteditable]'));
966+
var content = 'Change me!';
967967
968-
// Firefox driver doesn't trigger the proper events on 'clear', so do this hack
969-
contentEditable.click();
970-
contentEditable.sendKeys(protractor.Key.chord(protractor.Key.COMMAND, "a"));
971-
contentEditable.sendKeys(protractor.Key.BACK_SPACE);
968+
expect(contentEditable.getText()).toEqual(content);
972969
973-
expect(contentEditable.getText()).toEqual('');
974-
expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);
975-
});
970+
contentEditable.clear();
971+
contentEditable.sendKeys(protractor.Key.BACK_SPACE);
972+
expect(contentEditable.getText()).toEqual('');
973+
expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);
974+
});
976975
</file>
977976
* </example>
978977
*

0 commit comments

Comments
 (0)
X Tutup