module('Results - option');
var $ = require('jquery');
var Options = require('select2/options');
var Results = require('select2/results');
test('disabled property on option is respected - enabled', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
var option = results.option({
element: $option[0]
});
assert.notEqual(option.getAttribute('aria-disabled'), 'true');
});
test('disabled property on option is respected - disabled', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
var option = results.option({
element: $option[0]
});
assert.equal(option.getAttribute('aria-disabled'), 'true');
});
test('disabled property on enabled optgroup is respected', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
var option = results.option({
element: $option[0]
});
assert.notEqual(option.getAttribute('aria-disabled'), 'true');
});
test('disabled property on disabled optgroup is respected', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('');
var option = results.option({
element: $option[0]
});
assert.equal(option.getAttribute('aria-disabled'), 'true');
});
test('option in disabled optgroup is disabled', function (assert) {
var results = new Results($(''), new Options({}));
var $option = $('')
.find('option');
var option = results.option({
element: $option[0]
});
assert.equal(option.getAttribute('aria-disabled'), 'true');
});