Sha256: a99c97b526934e84cb5b97afb03e2e9ea8987cafb2a114fdcdffbcd23c704433
Contents?: true
Size: 1.04 KB
Versions: 86
Compression:
Stored size: 1.04 KB
Contents
module('Options - Attributes'); var $ = require('jquery'); var Options = require('select2/options'); test('no nesting', function (assert) { var $test = $('<select data-test="test"></select>'); var options = new Options({}, $test); assert.equal(options.get('test'), 'test'); }); test('with nesting', function (assert) { 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); assert.ok(!(options.get('first-Second'))); assert.equal(options.get('first').second, 'test'); }); test('overrides initialized data', function (assert) { var $test = $('<select data-override="yes" data-data="yes"></select>'); var options = new Options({ options: 'yes', override: 'no' }, $test); assert.equal(options.get('options'), 'yes'); assert.equal(options.get('override'), 'yes'); assert.equal(options.get('data'), 'yes'); });
Version data entries
86 entries across 86 versions & 7 rubygems