MDL-74800 core: block actions fix suggestion

This commit is contained in:
Jun Pataleta
2022-08-08 14:46:42 +02:00
committed by Ferran Recio
parent 950d617aec
commit 87e513e439
6 changed files with 17 additions and 4 deletions
@@ -108,6 +108,7 @@ class behat_partial_named_selector extends \Behat\Mink\Selector\PartialNamedSele
'link' => 'link',
'link_or_button' => 'link_or_button',
'list_item' => 'list_item',
'menuitem' => 'menuitem',
'optgroup' => 'optgroup',
'option' => 'option',
'question' => 'question',
@@ -201,6 +202,9 @@ XPATH
XPATH
, 'list_item' => <<<XPATH
.//li[contains(normalize-space(.), %locator%) and not(.//li[contains(normalize-space(.), %locator%)])]
XPATH
, 'menuitem' => <<<XPATH
.//*[@role='menuitem'][%titleMatch% or %ariaLabelMatch% or text()[contains(., %locator%)]]
XPATH
, 'question' => <<<XPATH
.//div[contains(concat(' ', normalize-space(@class), ' '), ' que ')]
@@ -933,6 +933,9 @@ BLOCKREGION.prototype = {
this.get('node').all('.' + CSS.BLOCK + ' a.' + CSS.EDITINGMOVE).each(function(moveicon) {
moveicon.setStyle('cursor', 'move');
handle = manager.get_drag_handle(moveicon.getAttribute('title'), '', 'icon', true);
// Dragdrop module assigns this with a button role by default.
// However, the block move icon is part of a menubar, so it should have a menuitem role.
handle.setAttribute('role', 'menuitem');
moveicon.replace(handle);
});
},
File diff suppressed because one or more lines are too long
@@ -926,6 +926,9 @@ BLOCKREGION.prototype = {
this.get('node').all('.' + CSS.BLOCK + ' a.' + CSS.EDITINGMOVE).each(function(moveicon) {
moveicon.setStyle('cursor', 'move');
handle = manager.get_drag_handle(moveicon.getAttribute('title'), '', 'icon', true);
// Dragdrop module assigns this with a button role by default.
// However, the block move icon is part of a menubar, so it should have a menuitem role.
handle.setAttribute('role', 'menuitem');
moveicon.replace(handle);
});
},
+3
View File
@@ -100,6 +100,9 @@ BLOCKREGION.prototype = {
this.get('node').all('.' + CSS.BLOCK + ' a.' + CSS.EDITINGMOVE).each(function(moveicon) {
moveicon.setStyle('cursor', 'move');
handle = manager.get_drag_handle(moveicon.getAttribute('title'), '', 'icon', true);
// Dragdrop module assigns this with a button role by default.
// However, the block move icon is part of a menubar, so it should have a menuitem role.
handle.setAttribute('role', 'menuitem');
moveicon.replace(handle);
});
},
+3 -3
View File
@@ -101,14 +101,14 @@ Feature: Run tests over my courses.
| Default region | Right |
And I press "Save changes"
And I should see "This is visible on all pages"
And "Move Text on all pages block" "button" should exist in the "Text on all pages" "block"
And "Move Text on all pages block" "menuitem" should exist in the "Text on all pages" "block"
When I am on the "My courses" page
# Check blocks visible but are "locked" in place.
Then "Course overview" "text" should exist in the "region-main" "region"
And I should not see "Add a block"
And I should see "This is visible on all pages"
And "Move Text on all pages block" "button" should not exist in the "Text on all pages" "block"
And "Move Course overview block" "button" should not exist in the "Course overview" "block"
And "Move Text on all pages block" "menuitem" should not exist in the "Text on all pages" "block"
And "Move Course overview block" "menuitem" should not exist in the "Course overview" "block"
And I click on "Actions menu" "icon" in the "Course overview" "block"
And I should not see "Delete Course overview block"