Skip to content

Commit e58bab9

Browse files
committed
Tests: Add tests for Boost Union features which might but must not affect other active themes, resolves #761 (#1072)
1 parent e7857ed commit e58bab9

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changes
66

77
### Unreleased
88

9+
* 2025-10-20 - Tests: Add tests for Boost Union features which might but must not affect other active themes, resolves #761
910
* 2025-10-16 - Feature: Add Bootstrap alert to Boost Union settings if Boost Union (or Boost Union Child) is not the active theme, resolves #773.
1011
* 2025-10-15 - Improvement: On course cards, display the course fields as Bootstrap badges, resolves #1070
1112

locallib.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,7 @@ function theme_boost_union_callbackimpl_before_standard_html(&$hook = null) {
21672167
if ($hook != null) {
21682168
// Add the HTML code to the hook.
21692169
$hook->add_html($html);
2170+
return;
21702171
} else {
21712172
// Return the HTML code.
21722173
return $html;
@@ -2179,6 +2180,7 @@ function theme_boost_union_callbackimpl_before_standard_html(&$hook = null) {
21792180
if ($hook != null) {
21802181
// Add the HTML code to the hook.
21812182
$hook->add_html($html);
2183+
return;
21822184
} else {
21832185
// Return the HTML code.
21842186
return $html;

tests/behat/theme_boost_union_accessibilitysettings_support.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ Feature: Configuring the theme_boost_union plugin for the "Support page" tab on
4949
| yes | should |
5050
| no | should not |
5151

52+
Scenario: Setting: Enable accessibility support page - Do not add the screen reader link to the page if Boost Union is not the active theme (cross-theme check).
53+
Given I log in as "admin"
54+
And the following config values are set as admin:
55+
| config | value | plugin |
56+
| enableaccessibilitysupport | yes | theme_boost_union |
57+
And I navigate to "Appearance > Themes" in site administration
58+
And I click on "Select theme" "button" in the "#theme-select-form-boost" "css_element"
59+
And I log out
60+
When I log in as "student1"
61+
And I am on site homepage
62+
Then "#access-support-form-sr-link" "css_element" should not exist
63+
5264
Scenario Outline: Setting: Allow accessibility support page without login - Check real user and guest
5365
Given the following config values are set as admin:
5466
| config | value | plugin |

tests/behat/theme_boost_union_feelsettings_navigation.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,22 @@ Feature: Configuring the theme_boost_union plugin for the "Navigation" tab on th
136136
| yes | should |
137137
| no | should not |
138138

139+
@javascript
140+
Scenario: Setting: Do not show starred courses popover in the navbar if Boost Union is not the active theme (cross-theme check).
141+
Given the following config values are set as admin:
142+
| config | value | plugin |
143+
| shownavbarstarredcourses | yes | theme_boost_union |
144+
And I log in as "admin"
145+
And I navigate to "Appearance > Themes" in site administration
146+
And I click on "Select theme" "button" in the "#theme-select-form-boost" "css_element"
147+
And I log out
148+
When I log in as "student1"
149+
And I follow "My courses"
150+
And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'card course-card') and contains(.,'Course 1')]" "xpath_element"
151+
And I click on "Star this course" "link" in the "//div[contains(@class, 'card course-card') and contains(.,'Course 1')]" "xpath_element"
152+
And I reload the page
153+
Then "nav.navbar #usernavigation .popover-region-favourites" "css_element" should not exist
154+
139155
@javascript
140156
Scenario: Setting: Show starred courses popover in the navbar (and make sure that I see the right courses there).
141157
Given the following config values are set as admin:

tests/behat/theme_boost_union_looksettings_mobile.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,17 @@ Feature: Configuring the theme_boost_union plugin for the "Mobile" tab on the "L
9999
Then I should not see "Touch icon files for iOS list"
100100
And ".settings-touchiconsios-filelist" "css_element" should not exist
101101
And Behat debugging is enabled
102+
103+
@javascript @_file_upload
104+
Scenario: Setting: Touch icon files for iOS - Do not ship touch icon files if Boost Union is not the active theme (cross-theme check).
105+
Given I log in as "admin"
106+
And I navigate to "Appearance > Themes" in site administration
107+
And I click on "Select theme" "button" in the "#theme-select-form-boost" "css_element"
108+
And Behat debugging is disabled
109+
And I navigate to "Appearance > Boost Union > Look" in site administration
110+
And I click on "Mobile" "link" in the "#adminsettings .nav-tabs" "css_element"
111+
And I upload "theme/boost_union/tests/fixtures/apple-icon-180x180.png" file to "Touch icon files for iOS" filemanager
112+
And I press "Save changes"
113+
And Behat debugging is enabled
114+
And I am on site homepage
115+
Then "//head//link[contains(@rel, 'apple-touch-icon')][contains(@sizes, '180x180')][contains(@href, 'pluginfile.php/1/theme_boost_union/touchiconsios')][contains(@href, 'apple-icon-180x180.png')]" "xpath_element" should not exist

0 commit comments

Comments
 (0)