data-tests.js 511 B

1234567891011121314151617181920
  1. module('Options - Attributes');
  2. var Options = require('select2/options');
  3. test('no nesting', function (assert) {
  4. var $test = $('<select data-test="test"></select>');
  5. var options = new Options({}, $test);
  6. assert.equal(options.get('test'), 'test');
  7. });
  8. test('with nesting', function (assert) {
  9. var $test = $('<select data-first--second="test"></select>');
  10. var options = new Options({}, $test);
  11. assert.ok(!(options.get('first-Second')));
  12. assert.equal(options.get('first').second, 'test');
  13. });