Skip to content

Commit 3548e28

Browse files
committed
Test: Change tests/fixtures/*.jpg to tests/fixtures/*.png to prevent resizing issues with JPG images
1 parent 39f4b8e commit 3548e28

20 files changed

+67
-63
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ moodle-theme_boost_union
44
Changes
55
-------
66

7+
### Unreleased
8+
9+
* 2024-10-14 - Test: Change tests/fixtures/*.jpg to tests/fixtures/*.png to prevent resizing issues with JPG images
10+
711
### v4.2-r19
812

913
* 2024-08-11 - Updated Moodle Plugin CI to latest upstream recommendations

templates/advertisementtiles.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
{
5858
"title": "",
5959
"content": "This text is shown in light font color",
60-
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg1.jpg",
60+
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg1.png",
6161
"linktitle": "",
6262
"link": "",
6363
"no": 3,

templates/settings-additionalresources-filelist.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
{
2727
"files": [
2828
{
29-
"fileicon": "<img class='icon ' alt='Image (JPEG)' title='Image (JPEG)' src='/theme/image.php/boost_union/core/1666077095/f/jpeg-64'>",
29+
"fileicon": "<img class='icon ' alt='Image (PNG)' title='Image (PNG)' src='/theme/image.php/boost_union/core/1666077095/f/png-64'>",
3030
"filename": "foo.jpg",
31-
"filetype": "image/jpeg",
31+
"filetype": "image/png",
3232
"filesize": "38.5 KB",
33-
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.jpg",
34-
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.jpg"
33+
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.png",
34+
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.png"
3535
}
3636
]
3737
}

templates/settings-customfonts-filelist.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
{
2727
"files": [
2828
{
29-
"fileicon": "<img class='icon ' alt='Image (JPEG)' title='Image (JPEG)' src='/theme/image.php/boost_union/core/1666077095/f/jpeg-64'>",
30-
"filename": "foo.jpg",
31-
"filetype": "image/jpeg",
29+
"fileicon": "<img class='icon ' alt='Image (+####)' title='Image (PNG)' src='/theme/image.php/boost_union/core/1666077095/f/png-64'>",
30+
"filename": "foo.png",
31+
"filetype": "image/png",
3232
"filesize": "38.5 KB",
33-
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.jpg",
34-
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.jpg"
33+
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.png",
34+
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.png"
3535
}
3636
]
3737
}

templates/slider.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"slides": [
6363
{
64-
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg1.jpg",
64+
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg1.png",
6565
"backgroundimagealt": "The background image 1",
6666
"captionorcontent": true,
6767
"caption": "The caption 1",
@@ -77,7 +77,7 @@
7777
"slideto": 0
7878
},
7979
{
80-
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg2.jpg",
80+
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg2.png",
8181
"backgroundimagealt": "The background image 2",
8282
"captionorcontent": true,
8383
"caption": "The caption 2",
@@ -93,7 +93,7 @@
9393
"slideto": 1
9494
},
9595
{
96-
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg3.jpg",
96+
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/master/tests/fixtures/login_bg3.png",
9797
"backgroundimagealt": "The background image 3",
9898
"captionorcontent": true,
9999
"caption": "The caption 3",

tests/behat/theme_boost_union_contentsettings_advertisementtiles.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Feature: Configuring the theme_boost_union plugin for the "Advertisement tiles"
188188
And Behat debugging is disabled
189189
And I navigate to "Appearance > Boost Union > Content" in site administration
190190
And I click on "Advertisement tiles" "link" in the "#adminsettings .nav-tabs" "css_element"
191-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Advertisement tile 1 background image" filemanager
191+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Advertisement tile 1 background image" filemanager
192192
And I press "Save changes"
193193
And I am on site homepage
194194
And Behat debugging is enabled
@@ -197,7 +197,7 @@ Feature: Configuring the theme_boost_union plugin for the "Advertisement tiles"
197197
And I follow "Log in"
198198
And I log in as "teacher1"
199199
And I am on site homepage
200-
Then "//div[@id='themeboostunionadvtile1']/*[1][contains(@style, 'pluginfile.php/1/theme_boost_union/tilebackgroundimage1/0/login_bg1.jpg')]" "xpath_element" should exist
200+
Then "//div[@id='themeboostunionadvtile1']/*[1][contains(@style, 'pluginfile.php/1/theme_boost_union/tilebackgroundimage1/0/login_bg1.png')]" "xpath_element" should exist
201201
And "//div[@id='themeboostunionadvtile2']/*[1][contains(@style, 'pluginfile.php')]" "xpath_element" should not exist
202202

203203
Scenario Outline: Setting: Advertisement tiles - Define the tile (min-)height.
@@ -227,7 +227,7 @@ Feature: Configuring the theme_boost_union plugin for the "Advertisement tiles"
227227
And Behat debugging is disabled
228228
And I navigate to "Appearance > Boost Union > Content" in site administration
229229
And I click on "Advertisement tiles" "link" in the "#adminsettings .nav-tabs" "css_element"
230-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Advertisement tile 1 background image" filemanager
230+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Advertisement tile 1 background image" filemanager
231231
And I press "Save changes"
232232
And I am on site homepage
233233
And Behat debugging is enabled

tests/behat/theme_boost_union_contentsettings_slider.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
1818
And Behat debugging is disabled
1919
And I navigate to "Appearance > Boost Union > Content" in site administration
2020
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
21-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 1 background image" filemanager
21+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 1 background image" filemanager
2222
And I press "Save changes"
2323
And I am on site homepage
2424
And Behat debugging is enabled
@@ -194,7 +194,7 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
194194
When I log in as "teacher1"
195195
And I am on site homepage
196196
Then "#themeboostunionslide1 > img" "css_element" should exist
197-
And the "src" attribute of "#themeboostunionslide1 > img" "css_element" should contain "pluginfile.php/1/theme_boost_union/slidebackgroundimage1/0/login_bg1.jpg"
197+
And the "src" attribute of "#themeboostunionslide1 > img" "css_element" should contain "pluginfile.php/1/theme_boost_union/slidebackgroundimage1/0/login_bg1.png"
198198
And the "alt" attribute of "#themeboostunionslide1 > img" "css_element" should contain "This is the image description"
199199

200200
Scenario: Setting: Slider - Display an individual slide only if an image is uploaded
@@ -262,16 +262,16 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
262262
And Behat debugging is disabled
263263
And I navigate to "Appearance > Boost Union > Content" in site administration
264264
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
265-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 2 background image" filemanager
265+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 2 background image" filemanager
266266
# For a strange reason, Behat fails if we upload all images at once. So we simply save the form after each upload.
267267
And I press "Save changes"
268268
And I navigate to "Appearance > Boost Union > Content" in site administration
269269
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
270-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 3 background image" filemanager
270+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 3 background image" filemanager
271271
And I press "Save changes"
272272
And I navigate to "Appearance > Boost Union > Content" in site administration
273273
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
274-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 4 background image" filemanager
274+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 4 background image" filemanager
275275
And I press "Save changes"
276276
And I am on site homepage
277277
And Behat debugging is enabled
@@ -323,16 +323,16 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
323323
And Behat debugging is disabled
324324
And I navigate to "Appearance > Boost Union > Content" in site administration
325325
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
326-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 2 background image" filemanager
326+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 2 background image" filemanager
327327
# For a strange reason, Behat fails if we upload all images at once. So we simply save the form after each upload.
328328
And I press "Save changes"
329329
And I navigate to "Appearance > Boost Union > Content" in site administration
330330
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
331-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 4 background image" filemanager
331+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 4 background image" filemanager
332332
And I press "Save changes"
333333
And I navigate to "Appearance > Boost Union > Content" in site administration
334334
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
335-
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 6 background image" filemanager
335+
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 6 background image" filemanager
336336
And I press "Save changes"
337337
And I am on site homepage
338338
And Behat debugging is enabled

0 commit comments

Comments
 (0)