summaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-02-06 21:25:55 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-02-06 21:25:55 +0100
commitd247e237b64bb51384123ccab8b4b9c54bb22e55 (patch)
tree3f67658253354b173dbb924bc86bf5c4670c8006 /cypress
parent7b4914bce59d15f5fc34de61ab65460cfcf48bac (diff)
downloadnextcloud-server-d247e237b64bb51384123ccab8b4b9c54bb22e55.tar.gz
nextcloud-server-d247e237b64bb51384123ccab8b4b9c54bb22e55.zip
fix(cypress): Adjust cypress tests for changed theming
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/theming/themingUtils.ts13
-rw-r--r--cypress/e2e/theming/user-background.cy.ts4
2 files changed, 11 insertions, 6 deletions
diff --git a/cypress/e2e/theming/themingUtils.ts b/cypress/e2e/theming/themingUtils.ts
index de0c5acd973..2965886c656 100644
--- a/cypress/e2e/theming/themingUtils.ts
+++ b/cypress/e2e/theming/themingUtils.ts
@@ -21,8 +21,8 @@
*/
import { colord } from 'colord'
-export const defaultPrimary = '#0082c9'
-export const defaultAccessiblePrimary = '#00679e'
+const defaultNextcloudBlue = '#0082c9'
+export const defaultPrimary = '#00679e'
export const defaultBackground = 'kamil-porembinski-clouds.jpg'
/**
@@ -60,14 +60,19 @@ export const validateUserThemingDefaultCss = function(expectedColor = defaultPri
const defaultOptionBackground = defaultSelectButton.css('background-image')
const colorPickerOptionColor = defaultSelectButton.css('background-color')
+ const isNextcloudBlue = colord(colorPickerOptionColor).isEqual('#0082c9')
const isValidBackgroundImage = !expectedBackground
? defaultOptionBackground === 'none'
: defaultOptionBackground.includes(expectedBackground)
- console.debug({ colorPickerOptionColor: colord(colorPickerOptionColor).toHex(), expectedColor, isValidBackgroundImage })
+ console.debug({ colorPickerOptionColor: colord(colorPickerOptionColor).toHex(), expectedColor, isValidBackgroundImage, isNextcloudBlue })
- return isValidBackgroundImage && colord(colorPickerOptionColor).isEqual(expectedColor)
+ return isValidBackgroundImage && (
+ colord(colorPickerOptionColor).isEqual(expectedColor)
+ // we replace nextcloud blue with the the default rpimary (apps/theming/lib/Themes/DefaultTheme.php line 76)
+ || (isNextcloudBlue && colord(expectedColor).isEqual(defaultPrimary))
+ )
}
export const pickRandomColor = function(): Cypress.Chainable<string> {
diff --git a/cypress/e2e/theming/user-background.cy.ts b/cypress/e2e/theming/user-background.cy.ts
index e024ea4b5e9..cdf3ef59f4d 100644
--- a/cypress/e2e/theming/user-background.cy.ts
+++ b/cypress/e2e/theming/user-background.cy.ts
@@ -95,7 +95,7 @@ describe('User select shipped backgrounds and remove background', function() {
// Validate changed background and primary
cy.wait('@setBackground')
- cy.waitUntil(() => validateBodyThemingCss('#56633d', background))
+ cy.waitUntil(() => validateBodyThemingCss('#869171', background))
})
it('Remove background', function() {
@@ -109,7 +109,7 @@ describe('User select shipped backgrounds and remove background', function() {
// Validate clear background
cy.wait('@clearBackground')
- cy.waitUntil(() => validateBodyThemingCss('#56633d', null))
+ cy.waitUntil(() => validateBodyThemingCss('#869171', null))
})
})