From fe434307d15d697a5ffade51bad068f6443965b2 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 22 Apr 2010 17:11:56 -0700 Subject: tests work under jquery and without --- test/testabilityPatch.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/testabilityPatch.js') diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index e5eef63e..b05770c7 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -148,3 +148,12 @@ function assertThrows(error, fn){ log = noop; error = noop; + +function click(element) { + element = jqLite(element); + if ( (msie || jqLite == window.jQuery) && + nodeName(element) == 'INPUT' && (lowercase(element.attr('type')) == 'radio' || lowercase(element.attr('type')) == 'checkbox')) { + element[0].checked = ! element[0].checked; + } + element.trigger('click'); +} -- cgit v1.2.3