Skip to content

Commit

Permalink
fix behat tests and grunt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Syxton committed Oct 20, 2023
1 parent b0cc959 commit aff4223
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion amd/build/massactionblock.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/massactionblock.min.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions amd/src/massactionblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,18 @@ export const init = async() => {
// Remove sticky footer.
disableStickyFooter();

// Show course module menu by removing the class that hides them.
return true;
})
.then(() => {
// Show module tools by removing the classes that hides them.
let elem;
for (elem of document.getElementsByClassName("bulk-hidden")) {
elem.classList.remove("bulk-hidden");
}
return true;

for (elem of document.querySelectorAll('[data-inplaceeditablelink]')) {
elem.classList.remove("d-none");
}
})
.catch(error => Log.debug(error));

Expand Down
4 changes: 0 additions & 4 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,3 @@
.course-section-header .bulkselect {
display: none;
}

a[data-inplaceeditablelink] {
display: initial !important;
}
1 change: 0 additions & 1 deletion tests/behat/actions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Feature: Check if all the different type of actions of the mass actions block wo
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"

@javascript
Scenario: Check if mass actions 'hide' and 'show' work
Expand Down
2 changes: 0 additions & 2 deletions tests/behat/core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Feature: Check if in format_topics block properly disables the currently not act
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"
# Dropdown list is being generated by JS, so we need to wait a bit until this has been loaded.
And I wait "3" seconds
And I set the field "target_section_selecting_all" to "Topic 1"
Expand Down Expand Up @@ -70,7 +69,6 @@ Feature: Check if in format_topics block properly disables the currently not act
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"
And I click on "Test Activity1" "checkbox"
And I click on "Test Activity4" "checkbox"
Then the field "Test Activity1" matches value "1"
Expand Down
1 change: 0 additions & 1 deletion tests/behat/grid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Feature: Check if in format_grid block properly disables the currently not activ
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"
And I click on "Test Activity1" "checkbox"
And I click on "Test Activity4" "checkbox"
Then the field "Test Activity1" matches value "1"
Expand Down
5 changes: 0 additions & 5 deletions tests/behat/onetopic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Feature: Check if in format_onetopic block properly disables the currently not a
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"
When I click on ".nav-link[title='General']" "css_element"
And I click on "Test Activity1" "checkbox"
Then the field "Test Activity1" matches value "1"
Expand All @@ -33,11 +32,9 @@ Feature: Check if in format_onetopic block properly disables the currently not a
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-3" "css_element" should be set
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-4" "css_element" should be set
When I click on ".nav-link[title='Topic 4']" "css_element"
And I click on "Bulk edit" "button"
And I click on "Test Activity4" "checkbox"
Then the field "Test Activity4" matches value "1"
When I click on ".nav-link[title='Topic 2']" "css_element"
And I click on "Bulk edit" "button"
And I click on "Label text" "checkbox"
Then the field "Label text" matches value "1"
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-0" "css_element" should be set
Expand All @@ -46,7 +43,6 @@ Feature: Check if in format_onetopic block properly disables the currently not a
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-3" "css_element" should be set
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-4" "css_element" should be set
When I click on ".nav-link[title='Topic 3']" "css_element"
And I click on "Bulk edit" "button"
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-0" "css_element" should be set
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-1" "css_element" should be set
Then the "disabled" attribute of "#block-massaction-control-section-list-select-option-2" "css_element" should be set
Expand Down Expand Up @@ -76,7 +72,6 @@ Feature: Check if in format_onetopic block properly disables the currently not a
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on ".nav-link[title='Topic 4']" "css_element"
And I click on "Bulk edit" "button"
# Everything is setup now, let's do the real test.
And I click on "Test Activity4" "checkbox"
And I click on "Test Activity5" "checkbox"
Expand Down
1 change: 0 additions & 1 deletion tests/behat/tiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Feature: Check if in format_tiles block properly disables the currently not acti
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"
And I click on "Test Activity1" "checkbox"
And I click on "Test Activity4" "checkbox"
Then the field "Test Activity1" matches value "1"
Expand Down
2 changes: 0 additions & 2 deletions tests/behat/topcoll.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Feature: Check if in format_topcoll block properly disables the currently not ac
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"
And I click on "Open all" "text"
And I click on "Test Activity1" "checkbox"
And I click on "Test Activity4" "checkbox"
Expand Down Expand Up @@ -60,7 +59,6 @@ Feature: Check if in format_topcoll block properly disables the currently not ac
When I log in as "teacher1"
And I am on "Test course" course homepage with editing mode on
And I add the "Mass Actions" block
And I click on "Bulk edit" "button"
# Everything is setup now, let's do the real test.
And I click on "Open all" "text"
And I click on "Test Activity2" "checkbox"
Expand Down

0 comments on commit aff4223

Please sign in to comment.