From 540b78d92026de6e287144b9bf37221699ccb9e8 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Fri, 25 Feb 2011 11:33:48 +0100 Subject: 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. --- tests/unit/menu/menu_methods.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tests/unit/menu') diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js index b6ebaf215..0ecaf7328 100644 --- a/tests/unit/menu/menu_methods.js +++ b/tests/unit/menu/menu_methods.js @@ -6,13 +6,9 @@ module("menu: methods"); test("destroy", function() { - var beforeHtml = $("#menu1").find("div").css("font-style", "normal").end().parent().html(); - var afterHtml = $("#menu1").menu().menu("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 ); + domEqual("#menu1", function() { + $("#menu1").menu().menu("destroy"); + }); }); -- cgit v1.2.3