diff options
Diffstat (limited to 'src/ng')
| -rw-r--r-- | src/ng/directive/input.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index f88af155..3169c6de 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -956,23 +956,22 @@ var VALID_CLASS = 'ng-valid', </form> </file> <file name="protractor.js" type="protractor"> - it('should data-bind and become invalid', function() { - if (browser.params.browser == 'safari') { - // SafariDriver can't handle contenteditable. - return; - } - var contentEditable = element(by.css('[contenteditable]')); - - expect(contentEditable.getText()).toEqual('Change me!'); + it('should data-bind and become invalid', function() { + if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') { + // SafariDriver can't handle contenteditable + // and Firefox driver can't clear contenteditables very well + return; + } + var contentEditable = element(by.css('[contenteditable]')); + var content = 'Change me!'; - // Firefox driver doesn't trigger the proper events on 'clear', so do this hack - contentEditable.click(); - contentEditable.sendKeys(protractor.Key.chord(protractor.Key.COMMAND, "a")); - contentEditable.sendKeys(protractor.Key.BACK_SPACE); + expect(contentEditable.getText()).toEqual(content); - expect(contentEditable.getText()).toEqual(''); - expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/); - }); + contentEditable.clear(); + contentEditable.sendKeys(protractor.Key.BACK_SPACE); + expect(contentEditable.getText()).toEqual(''); + expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/); + }); </file> * </example> * |
