Skip to content

Commit

Permalink
Test: Change tests/fixtures/*.jpg to tests/fixtures/*.png to prevent …
Browse files Browse the repository at this point in the history
…resizing issues with JPG images
  • Loading branch information
abias committed Oct 21, 2024
1 parent eb8c0f7 commit b9fa4ca
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 65 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ moodle-theme_boost_union
Changes
-------

### Unreleased

* 2024-10-14 - Test: Change tests/fixtures/*.jpg to tests/fixtures/*.png to prevent resizing issues with JPG images

### v4.4-r2

* 2024-10-09 - Bugfix: Course category breadcrumbs were broken on the course enrolment page due to MDL-80974 and were removed, resolves #727.
Expand Down
2 changes: 1 addition & 1 deletion templates/advertisementtiles.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{
"title": "",
"content": "This text is shown in light font color",
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg1.jpg",
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg1.png",
"linktitle": "",
"link": "",
"no": 3,
Expand Down
10 changes: 5 additions & 5 deletions templates/settings-additionalresources-filelist.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
{
"files": [
{
"fileicon": "<img class='icon ' alt='Image (JPEG)' title='Image (JPEG)' src='/theme/image.php/boost_union/core/1666077095/f/jpeg-64'>",
"filename": "foo.jpg",
"filetype": "image/jpeg",
"fileicon": "<img class='icon ' alt='Image (PNG)' title='Image (PNG)' src='/theme/image.php/boost_union/core/1666077095/f/png-64'>",
"filename": "foo.png",
"filetype": "image/png",
"filesize": "38.5 KB",
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.jpg",
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.jpg"
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.png",
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.png"
}
]
}
Expand Down
10 changes: 5 additions & 5 deletions templates/settings-customfonts-filelist.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
{
"files": [
{
"fileicon": "<img class='icon ' alt='Image (JPEG)' title='Image (JPEG)' src='/theme/image.php/boost_union/core/1666077095/f/jpeg-64'>",
"filename": "foo.jpg",
"filetype": "image/jpeg",
"fileicon": "<img class='icon ' alt='Image (PNG)' title='Image (PNG)' src='/theme/image.php/boost_union/core/1666077095/f/png-64'>",
"filename": "foo.png",
"filetype": "image/png",
"filesize": "38.5 KB",
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.jpg",
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.jpg"
"fileurlpersistent": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/0/foo.png",
"fileurlrevisioned": "http://localhost/pluginfile.php/1/theme_boost_union/additionalresources/1666077095/foo.png"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions templates/settings-touchiconsios-filelist.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{
"exists": true,
"recommended": true,
"filename": "apple-icon-152x152.jpg",
"filename": "apple-icon-152x152.png",
"size": "152x152"
},
{
Expand All @@ -40,7 +40,7 @@
{
"exists": false,
"recommended": false,
"filename": "apple-icon-60x60.jpg",
"filename": "apple-icon-60x60.png",
"size": "60x60"
}
]
Expand Down
6 changes: 3 additions & 3 deletions templates/slider.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"slides": [
{
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg1.jpg",
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg1.png",
"backgroundimagealt": "The background image 1",
"captionorcontent": true,
"caption": "The caption 1",
Expand All @@ -77,7 +77,7 @@
"slideto": 0
},
{
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg2.jpg",
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg2.png",
"backgroundimagealt": "The background image 2",
"captionorcontent": true,
"caption": "The caption 2",
Expand All @@ -93,7 +93,7 @@
"slideto": 1
},
{
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg3.jpg",
"backgroundimageurl": "https://raw.githubusercontent.com/moodle-an-hochschulen/moodle-theme_boost_union/main/tests/fixtures/login_bg3.png",
"backgroundimagealt": "The background image 3",
"captionorcontent": true,
"caption": "The caption 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Feature: Configuring the theme_boost_union plugin for the "Advertisement tiles"
And Behat debugging is disabled
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Advertisement tiles" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Advertisement tile 1 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Advertisement tile 1 background image" filemanager
And I press "Save changes"
And I am on site homepage
And Behat debugging is enabled
Expand All @@ -197,7 +197,7 @@ Feature: Configuring the theme_boost_union plugin for the "Advertisement tiles"
And I follow "Log in"
And I log in as "teacher1"
And I am on site homepage
Then "//div[@id='themeboostunionadvtile1']/*[1][contains(@style, 'pluginfile.php/1/theme_boost_union/tilebackgroundimage1/0/login_bg1.jpg')]" "xpath_element" should exist
Then "//div[@id='themeboostunionadvtile1']/*[1][contains(@style, 'pluginfile.php/1/theme_boost_union/tilebackgroundimage1/0/login_bg1.png')]" "xpath_element" should exist
And "//div[@id='themeboostunionadvtile2']/*[1][contains(@style, 'pluginfile.php')]" "xpath_element" should not exist

Scenario Outline: Setting: Advertisement tiles - Define the tile (min-)height.
Expand Down Expand Up @@ -227,7 +227,7 @@ Feature: Configuring the theme_boost_union plugin for the "Advertisement tiles"
And Behat debugging is disabled
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Advertisement tiles" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Advertisement tile 1 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Advertisement tile 1 background image" filemanager
And I press "Save changes"
And I am on site homepage
And Behat debugging is enabled
Expand Down
16 changes: 8 additions & 8 deletions tests/behat/theme_boost_union_contentsettings_slider.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
And Behat debugging is disabled
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 1 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 1 background image" filemanager
And I press "Save changes"
And I am on site homepage
And Behat debugging is enabled
Expand Down Expand Up @@ -194,7 +194,7 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
When I log in as "teacher1"
And I am on site homepage
Then "#themeboostunionslide1 > img" "css_element" should exist
And the "src" attribute of "#themeboostunionslide1 > img" "css_element" should contain "pluginfile.php/1/theme_boost_union/slidebackgroundimage1/0/login_bg1.jpg"
And the "src" attribute of "#themeboostunionslide1 > img" "css_element" should contain "pluginfile.php/1/theme_boost_union/slidebackgroundimage1/0/login_bg1.png"
And the "alt" attribute of "#themeboostunionslide1 > img" "css_element" should contain "This is the image description"

Scenario: Setting: Slider - Display an individual slide only if an image is uploaded
Expand Down Expand Up @@ -262,16 +262,16 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
And Behat debugging is disabled
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 2 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 2 background image" filemanager
# For a strange reason, Behat fails if we upload all images at once. So we simply save the form after each upload.
And I press "Save changes"
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 3 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 3 background image" filemanager
And I press "Save changes"
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 4 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 4 background image" filemanager
And I press "Save changes"
And I am on site homepage
And Behat debugging is enabled
Expand Down Expand Up @@ -323,16 +323,16 @@ Feature: Configuring the theme_boost_union plugin for the "Slider" tab on the "C
And Behat debugging is disabled
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 2 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 2 background image" filemanager
# For a strange reason, Behat fails if we upload all images at once. So we simply save the form after each upload.
And I press "Save changes"
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 4 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 4 background image" filemanager
And I press "Save changes"
And I navigate to "Appearance > Boost Union > Content" in site administration
And I click on "Slider" "link" in the "#adminsettings .nav-tabs" "css_element"
And I upload "theme/boost_union/tests/fixtures/login_bg1.jpg" file to "Slide 6 background image" filemanager
And I upload "theme/boost_union/tests/fixtures/login_bg1.png" file to "Slide 6 background image" filemanager
And I press "Save changes"
And I am on site homepage
And Behat debugging is enabled
Expand Down
Loading

0 comments on commit b9fa4ca

Please sign in to comment.