summaryrefslogtreecommitdiff
path: root/js_tests
diff options
context:
space:
mode:
authorGappleBee <irrationalmathematicspro7@gmail.com>2024-10-24 19:44:31 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-11-20 13:23:18 +0100
commit857b1048d53ebf5fc5581c110e85c212b81ca83a (patch)
tree160d5e34509f0491da39358d1061c69a92d03cea /js_tests
parentf60d5e46e131b94d6ecc92b6891689ccc94bd1c9 (diff)
Fixed #34619 -- Associated FilteredSelectMultiple elements to their label and help text.
Diffstat (limited to 'js_tests')
-rw-r--r--js_tests/admin/SelectFilter2.test.js24
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) {