1
0
mirror of synced 2024-11-22 21:16:10 +03:00

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.
This commit is contained in:
Kevin Brown 2015-03-11 19:46:48 -04:00
parent 992652bbd2
commit 55d3c636cc
2 changed files with 10 additions and 1 deletions

View File

@ -97,7 +97,7 @@ The license is available within the repository in the [LICENSE][license] file.
[select2-rails]: https://github.com/argerim/select2-rails [select2-rails]: https://github.com/argerim/select2-rails
[symfony-select2]: https://github.com/19Gerhard85/sfSelect2WidgetsPlugin [symfony-select2]: https://github.com/19Gerhard85/sfSelect2WidgetsPlugin
[symfony2-select2]: https://github.com/avocode/FormExtensions [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 [travis-ci-status]: https://travis-ci.org/select2/select2
[wicket]: http://wicket.apache.org [wicket]: http://wicket.apache.org
[wicket-select2]: https://github.com/ivaynberg/wicket-select2 [wicket-select2]: https://github.com/ivaynberg/wicket-select2

View File

@ -15,6 +15,15 @@ test('no nesting', function (assert) {
test('with nesting', function (assert) { test('with nesting', function (assert) {
var $test = $('<select data-first--second="test"></select>'); var $test = $('<select data-first--second="test"></select>');
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); var options = new Options({}, $test);
assert.ok(!(options.get('first-Second'))); assert.ok(!(options.get('first-Second')));