2019-08-08 04:16:45 +03:00
|
|
|
QUnit.module('Results - Accessibility');
|
2019-08-08 04:25:01 +03:00
|
|
|
|
|
|
|
var $ = require('jquery');
|
|
|
|
|
|
|
|
var Options = require('select2/options');
|
|
|
|
|
|
|
|
var Results = require('select2/results');
|
|
|
|
|
2019-08-08 04:16:45 +03:00
|
|
|
QUnit.test('role of results should be a listbox', function (assert) {
|
2019-08-08 04:25:01 +03:00
|
|
|
var results = new Results($('<select></select>'), new Options({}));
|
|
|
|
|
|
|
|
var $results = results.render();
|
|
|
|
|
|
|
|
assert.equal($results.attr('role'), 'listbox');
|
|
|
|
});
|
|
|
|
|
2019-08-08 04:16:45 +03:00
|
|
|
QUnit.test('multiple select should have aria-multiselectable', function (assert) {
|
2019-08-08 04:25:01 +03:00
|
|
|
var results = new Results($('<select></select>'), new Options({
|
|
|
|
multiple: true
|
|
|
|
}));
|
|
|
|
|
|
|
|
var $results = results.render();
|
|
|
|
|
|
|
|
assert.equal($results.attr('aria-multiselectable'), 'true');
|
|
|
|
});
|