diff options
Diffstat (limited to 'cypress/e2e/theming/user-background.cy.ts')
-rw-r--r-- | cypress/e2e/theming/user-background.cy.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cypress/e2e/theming/user-background.cy.ts b/cypress/e2e/theming/user-background.cy.ts index 846bc984fe1..ded0d89efec 100644 --- a/cypress/e2e/theming/user-background.cy.ts +++ b/cypress/e2e/theming/user-background.cy.ts @@ -23,16 +23,17 @@ import type { User } from '@nextcloud/cypress' const defaultPrimary = '#006aa3' const defaultBackground = 'kamil-porembinski-clouds.jpg' +import { colord } from 'colord' const validateThemingCss = function(expectedPrimary = '#0082c9', expectedBackground = 'kamil-porembinski-clouds.jpg', bright = false) { return cy.window().then((win) => { - const primary = getComputedStyle(win.document.body).getPropertyValue('--color-primary') - const background = getComputedStyle(win.document.body).getPropertyValue('--image-background') + const backgroundColor = getComputedStyle(win.document.body).backgroundColor + const backgroundImage = getComputedStyle(win.document.body).backgroundImage const invertIfBright = getComputedStyle(win.document.body).getPropertyValue('--background-image-invert-if-bright') // Returning boolean for cy.waitUntil usage - return primary === expectedPrimary - && background.includes(expectedBackground) + return colord(backgroundColor).isEqual(expectedPrimary) + && backgroundImage.includes(expectedBackground) && invertIfBright === (bright ? 'invert(100%)' : 'no') }) } @@ -163,7 +164,6 @@ describe('User select a custom background', function() { }) }) - describe('User changes settings and reload the page', function() { const image = 'image.jpg' const primaryFromImage = '#4c0c04' |