diff options
| author | Peter Bacon Darwin | 2014-02-15 21:58:31 +0000 | 
|---|---|---|
| committer | Peter Bacon Darwin | 2014-02-16 19:03:45 +0000 | 
| commit | 896e34689dfe0d66c09627179940a7b3eaac41bc (patch) | |
| tree | b2d9f9994dacddafde6feccd5dcb3b27724471d5 /src/ng/directive/input.js | |
| parent | 0b28de1e550d4811cd7206d2883fde157e500e83 (diff) | |
| download | angular.js-896e34689dfe0d66c09627179940a7b3eaac41bc.tar.bz2 | |
docs(NgModelController): don't run contenteditable example on FF
Diffstat (limited to 'src/ng/directive/input.js')
| -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>   * | 
