diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2011-02-25 11:33:48 +0100 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2011-02-25 11:33:48 +0100 |
commit | 540b78d92026de6e287144b9bf37221699ccb9e8 (patch) | |
tree | 78064c3b34c6ac94f4bf8877d8ad823f65e537d3 /tests/unit/autocomplete/autocomplete_methods.js | |
parent | 6a5eb351c767c3e5879d2cdcd4489b5afa7f03de (diff) | |
download | jquery-ui-540b78d92026de6e287144b9bf37221699ccb9e8.tar.gz jquery-ui-540b78d92026de6e287144b9bf37221699ccb9e8.zip |
Adding a domEqual assertion to our testsuite for more sane DOM
comparisons. Comparing innerHTML is too dependent on random browser
quirks like IE only sometimes rendering closing tags.
Diffstat (limited to 'tests/unit/autocomplete/autocomplete_methods.js')
-rw-r--r-- | tests/unit/autocomplete/autocomplete_methods.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/unit/autocomplete/autocomplete_methods.js b/tests/unit/autocomplete/autocomplete_methods.js index 05a7d6e14..1043e47ba 100644 --- a/tests/unit/autocomplete/autocomplete_methods.js +++ b/tests/unit/autocomplete/autocomplete_methods.js @@ -11,13 +11,9 @@ module("autocomplete: methods", { }); test("destroy", function() { - var beforeHtml = $("#autocomplete").parent().html(); - var afterHtml = $("#autocomplete").autocomplete().autocomplete("destroy").parent().html(); - // Opera 9 outputs role="" instead of removing the attribute like everyone else - if ($.browser.opera) { - afterHtml = afterHtml.replace(/ role=""/g, ""); - } - equal( afterHtml, beforeHtml, "before/after html should be the same" ); + domEqual("#autocomplete", function() { + $("#autocomplete").autocomplete().autocomplete("destroy"); + }); }) var data = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"]; |