Skip to content

Commit

Permalink
ALLY-12: Fix behat tests for 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gthomas2 committed Aug 7, 2024
1 parent adfe069 commit f57bc51
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion amd/build/main.min.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

23 changes: 16 additions & 7 deletions amd/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,26 @@ function($, Templates, Strings, Ally, ImageCover, Util) {
* @param {string} module
* @param {array} additionalSelectors
*/
var annotateModuleIntros = function(introMapping, module, additionalSelectors) {
for (var i in introMapping) {
var annotation = introMapping[i];
var selectors = [
const annotateModuleIntros = function(introMapping, module, additionalSelectors) {
for (const i in introMapping) {
const annotation = introMapping[i];

// Description selector for when activity modules show a description on the course page.
// We need to be specific here for non course pages to skip this.
const descriptionSelector = self.config.moodleversion >= 2023100900 ?
// Selector for Moodle 4.3+
'li.activity.modtype_' + module + '#module-' + i + ' .activity-description .no-overflow > .no-overflow' :
// Selector for < Moodle 4.3
'li.activity.modtype_' + module + '#module-' + i + ' .description .no-overflow > .no-overflow';

const selectors = [
'body.path-mod-' + module + '.cmid-' + i + ' #intro > .no-overflow',
// We need to be specific here for non course pages to skip this.
'li.activity.modtype_' + module + '#module-' + i + ' .description .no-overflow > .no-overflow',
descriptionSelector,
'li.snap-activity.modtype_' + module + '#module-' + i + ' .contentafterlink > .no-overflow'
];

if (additionalSelectors) {
for (var a in additionalSelectors) {
for (const a in additionalSelectors) {
selectors.push(additionalSelectors[a].replace('{{i}}', i));
}
}
Expand Down
3 changes: 2 additions & 1 deletion filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ public function setup($page, $context) {
$configvars = (object) [
'adminurl' => !empty($config->adminurl) ? $config->adminurl : null,
'pushurl' => !empty($config->pushurl) ? $config->pushurl : null,
'clientid' => !empty($config->clientid) ? $config->clientid : null
'clientid' => !empty($config->clientid) ? $config->clientid : null,
'moodleversion' => $CFG->version
];

$params = new stdClass();
Expand Down

0 comments on commit f57bc51

Please sign in to comment.