diff options
| author | Misko Hevery | 2011-02-03 16:35:51 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-02-04 13:44:22 -0800 |
| commit | 46d690ff0188836688811dda9af1b99c44750c48 (patch) | |
| tree | f2253031ba3c8574ec93f03a18bb9fb2667aef51 /test/markupSpec.js | |
| parent | 882f412d578e4f01394847fa5fde21b6b4096de2 (diff) | |
| download | angular.js-46d690ff0188836688811dda9af1b99c44750c48.tar.bz2 | |
smarter normalization of value on option, and htmlParser fixes
Diffstat (limited to 'test/markupSpec.js')
| -rw-r--r-- | test/markupSpec.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/markupSpec.js b/test/markupSpec.js index f629378d..16efba55 100644 --- a/test/markupSpec.js +++ b/test/markupSpec.js @@ -46,10 +46,18 @@ describe("markups", function(){ this.addMatchers({ toHaveValue: function(expected){ this.message = function(){ - return 'Expected "' + sortedHtml(this.actual) + '" to have value="' + expected + '".'; + return 'Expected "' + this.actual.html() + '" to have value="' + expected + '".'; }; - return this.actual.html().indexOf('value="' + expected + '"') != -1; + var value; + htmlParser(this.actual.html(), { + start:function(tag, attrs){ + value = attrs.value; + }, + end:noop, + chars:noop + }); + return trim(value) == trim(expected); } }); }); @@ -70,6 +78,8 @@ describe("markups", function(){ }); it('should set value even if self closing HTML', function(){ + // IE removes the \n from option, which makes this test pointless + if (msie) return; compile('<select name="x"><option>\n</option></select>'); expect(element).toHaveValue('\n'); }); |
