aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/testsuite.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-11-09 15:02:12 -0500
committerMike Sherov <mike.sherov@gmail.com>2012-11-09 15:02:26 -0500
commit543abc9b1ff6cafdea7cd1be5835f04104cdb8da (patch)
treec4886ef622e2150727a17c9b834773b359849cc1 /tests/unit/testsuite.js
parentfd48568c402847df8af59166c33549f0d19feb4b (diff)
downloadjquery-ui-543abc9b1ff6cafdea7cd1be5835f04104cdb8da.tar.gz
jquery-ui-543abc9b1ff6cafdea7cd1be5835f04104cdb8da.zip
Dev: clean up dialog test suite with new helper methods. Fixes #8803 - Dev: re-enable the dialog test suite
Diffstat (limited to 'tests/unit/testsuite.js')
-rw-r--r--tests/unit/testsuite.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js
index bf17670f7..f3c0982fb 100644
--- a/tests/unit/testsuite.js
+++ b/tests/unit/testsuite.js
@@ -170,6 +170,14 @@ TestHelpers.commonWidgetTests = function( widget, settings ) {
};
/*
+ * Taken from https://github.com/jquery/qunit/tree/master/addons/close-enough
+ */
+window.closeEnough = function( actual, expected, maxDifference, message ) {
+ var passes = (actual === expected) || Math.abs(actual - expected) <= maxDifference;
+ QUnit.push(passes, actual, expected, message);
+};
+
+/*
* Experimental assertion for comparing DOM objects.
*
* Serializes an element and some properties and attributes and it's children if any, otherwise the text.