FIX: Color palette switching when Horizon is not default (#95)
When Horizon is not the default theme, and the color palette switcher is used, we were ending up in a broken CSS state because the color definitions were not loaded correctly when calling `/color-scheme-stylesheet/` to get the new stylesheet URLs. The problem was that we were not giving the theme ID to this URL, we were only doing `/color-scheme-stylesheet/:palette_id`, not `/color-scheme-stylesheet/:palette_id/:theme_id`, so the theme color definitions like the ones that define the background color were not loaded. This commit fixes the issue and also changes to recreating the `<link>` tags for the CSS in the head so we can check if they are loaded correctly for easier testing in system specs.
This commit is contained in:
@@ -29,6 +29,10 @@ module PageObjects
|
||||
has_css?(".user-color-palette-selector[data-selected-color-palette-id='#{palette.id}']")
|
||||
end
|
||||
|
||||
def has_loaded_css?
|
||||
has_css?(".user-color-palette-selector.user-color-palette-css-loaded")
|
||||
end
|
||||
|
||||
def has_tertiary_color?(palette)
|
||||
computed_color_hex =
|
||||
page.evaluate_script(
|
||||
|
||||
Reference in New Issue
Block a user