diff options
Diffstat (limited to 'js_tests')
| -rw-r--r-- | js_tests/admin/SelectFilter2.test.js | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/js_tests/admin/SelectFilter2.test.js b/js_tests/admin/SelectFilter2.test.js index 0b1317cff5..af227c0c1e 100644 --- a/js_tests/admin/SelectFilter2.test.js +++ b/js_tests/admin/SelectFilter2.test.js @@ -12,13 +12,25 @@ QUnit.test('init', function(assert) { SelectFilter.init('id', 'things', 0); assert.equal($('#test').children().first().prop("tagName"), "DIV"); assert.equal($('#test').children().first().attr("class"), "selector"); - assert.equal($('.selector-available h2').text().trim(), "Available things"); - assert.equal($('.selector-chosen h2').text().trim(), "Chosen things"); + assert.equal($('.selector-available label').text().trim(), "Available things"); + assert.equal($('.selector-chosen label').text().trim(), "Chosen things"); assert.equal($('.selector-chosen select')[0].getAttribute('multiple'), ''); - assert.equal($('.selector-chooseall').text(), "Choose all"); - assert.equal($('.selector-add').text(), "Choose"); - assert.equal($('.selector-remove').text(), "Remove"); - assert.equal($('.selector-clearall').text(), "Remove all"); + assert.equal($('.selector-chooseall').text(), "Choose all things"); + assert.equal($('.selector-chooseall').prop("tagName"), "BUTTON"); + assert.equal($('.selector-add').text(), "Choose selected things"); + assert.equal($('.selector-add').prop("tagName"), "BUTTON"); + assert.equal($('.selector-remove').text(), "Remove selected chosen things"); + assert.equal($('.selector-remove').prop("tagName"), "BUTTON"); + assert.equal($('.selector-clearall').text(), "Remove all things"); + assert.equal($('.selector-clearall').prop("tagName"), "BUTTON"); + assert.equal($('.selector-available .filtered').attr("aria-labelledby"), "id_from_title"); + assert.equal($('.selector-available .selector-available-title label').text(), "Available things "); + assert.equal($('.selector-available .selector-available-title .helptext').text(), 'Choose things by selecting them and then select the "Choose" arrow button.'); + assert.equal($('.selector-chosen .filtered').attr("aria-labelledby"), "id_to_title"); + assert.equal($('.selector-chosen .selector-chosen-title label').text(), "Chosen things "); + assert.equal($('.selector-chosen .selector-chosen-title .helptext').text(), 'Remove things by selecting them and then select the "Remove" arrow button.'); + assert.equal($('.selector-filter label .help-tooltip')[0].getAttribute("aria-label"), "Type into this box to filter down the list of available things."); + assert.equal($('.selector-filter label .help-tooltip')[1].getAttribute("aria-label"), "Type into this box to filter down the list of selected things."); }); QUnit.test('filtering available options', function(assert) { |
