From 55d3c636cc16706bc33992ab1f989d445505aeda Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Wed, 11 Mar 2015 19:46:48 -0400 Subject: [PATCH] Skip the nested data test on unsupposed browsers The nested data attributes are only supported on jQuery 2.x or browsers which support the `dataset` attributes on DOM elements. In order to prevent test failures, and because tests cannot yet be skipped conditionally, we just cut the test early. --- README.md | 2 +- tests/options/data-tests.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8dc9d4c5..fbaf3fc8 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ The license is available within the repository in the [LICENSE][license] file. [select2-rails]: https://github.com/argerim/select2-rails [symfony-select2]: https://github.com/19Gerhard85/sfSelect2WidgetsPlugin [symfony2-select2]: https://github.com/avocode/FormExtensions -[travis-ci-image]: https://travis-ci.org/select2/select2.svg?branch=select2-ng +[travis-ci-image]: https://travis-ci.org/select2/select2.svg?branch=master [travis-ci-status]: https://travis-ci.org/select2/select2 [wicket]: http://wicket.apache.org [wicket-select2]: https://github.com/ivaynberg/wicket-select2 diff --git a/tests/options/data-tests.js b/tests/options/data-tests.js index d44771fd..107a2f0c 100644 --- a/tests/options/data-tests.js +++ b/tests/options/data-tests.js @@ -15,6 +15,15 @@ test('no nesting', function (assert) { test('with nesting', function (assert) { var $test = $(''); + if ($test[0].dataset == null) { + assert.ok( + true, + 'We can not run this test with jQuery 1.x if dataset is not implemented' + ); + + return; + } + var options = new Options({}, $test); assert.ok(!(options.get('first-Second')));