Skip to content

Commit

Permalink
[CIVIC-1204] Added SVG support for Logos.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-salsadigital committed Jul 12, 2023
1 parent c15ea94 commit 8612e4d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use Drupal\Core\Url;
* @SuppressWarnings(PHPMD.StaticAccess)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(ElseExpression)
*/
function civictheme_preprocess_block__system_branding_block(&$variables) {
$variables['show_site_logo'] = !empty($variables['elements']['#configuration']['use_site_logo']);
Expand Down
25 changes: 25 additions & 0 deletions tests/behat/features/theme.settings.components.feature
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,31 @@ Feature: Components settings are available in the theme settings
And I check the box "Confirm settings reset"
And I press "reset_to_defaults"
Then I should see the text "Theme configuration was reset to defaults."

@api
Scenario: The CivicTheme theme settings verify custom logo configuration with SVG image upload
Given I am logged in as a user with the "Site Administrator" role
And I visit current theme settings page

When I attach the file "test_svg.svg" to "Upload Primary Light logo for Desktop"
And I attach the file "test_svg.svg" to "Upload Primary Light logo for Mobile"
And I attach the file "test_svg.svg" to "Upload Primary Dark logo for Desktop"
And I attach the file "test_svg.svg" to "Upload Primary Dark logo for Mobile"
And I select the radio button "Light" with the id "edit-components-header-theme-light"
And I select the radio button "Default" with the id "edit-components-header-logo-type-default"
And I select the radio button "Dark" with the id "edit-components-footer-theme-dark"
And I select the radio button "Default" with the id "edit-components-footer-logo-type-default"
And I press "Save configuration"
Then I should see the text "The configuration options have been saved."

And I go to the homepage
And I should see an ".ct-logo svg.ct-logo__image" element

# Reset settings.
When I visit current theme settings page
And I check the box "Confirm settings reset"
And I press "reset_to_defaults"
Then I should see the text "Theme configuration was reset to defaults."

@api
Scenario: The CivicTheme theme settings External Links component validation works.
Expand Down

0 comments on commit 8612e4d

Please sign in to comment.