-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invert header if primary is bright and background disabled #35666
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -32,7 +32,7 @@ const defaultBackground = 'kamil-porembinski-clouds.jpg' | |||||
describe('Admin theming settings', function() { | ||||||
before(function() { | ||||||
// Just in case previous test failed | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
cy.login(admin) | ||||||
}) | ||||||
|
||||||
|
@@ -53,7 +53,7 @@ describe('Change the primary colour and reset it', function() { | |||||
let selectedColor = '' | ||||||
before(function() { | ||||||
// Just in case previous test failed | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
cy.login(admin) | ||||||
}) | ||||||
|
||||||
|
@@ -79,7 +79,7 @@ describe('Change the primary colour and reset it', function() { | |||||
}) | ||||||
|
||||||
it('Undo theming settings', function() { | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
}) | ||||||
|
||||||
it('Screenshot the login page', function() { | ||||||
|
@@ -92,7 +92,7 @@ describe('Change the primary colour and reset it', function() { | |||||
describe('Remove the default background and restore it', function() { | ||||||
before(function() { | ||||||
// Just in case previous test failed | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
cy.login(admin) | ||||||
}) | ||||||
|
||||||
|
@@ -122,7 +122,7 @@ describe('Remove the default background and restore it', function() { | |||||
}) | ||||||
|
||||||
it('Undo theming settings', function() { | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
}) | ||||||
|
||||||
it('Screenshot the login page', function() { | ||||||
|
@@ -132,14 +132,57 @@ describe('Remove the default background and restore it', function() { | |||||
}) | ||||||
}) | ||||||
|
||||||
describe.only('Remove the default background with a bright color', function() { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🙄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And now, everybody knows There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take the walk of shame 🙈 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
before(function() { | ||||||
// Just in case previous test failed | ||||||
cy.resetAdminTheming() | ||||||
cy.resetUserTheming(admin) | ||||||
cy.login(admin) | ||||||
}) | ||||||
|
||||||
it('See the admin theming section', function() { | ||||||
cy.visit('/settings/admin/theming') | ||||||
cy.get('[data-admin-theming-settings]').scrollIntoView().should('be.visible') | ||||||
}) | ||||||
|
||||||
it('Remove the default background', function() { | ||||||
cy.intercept('*/apps/theming/ajax/updateStylesheet').as('removeBackground') | ||||||
|
||||||
cy.get('[data-admin-theming-setting-file-remove]').click() | ||||||
|
||||||
cy.wait('@removeBackground') | ||||||
}) | ||||||
|
||||||
it('Change the primary colour', function() { | ||||||
cy.intercept('*/apps/theming/ajax/updateStylesheet').as('setColor') | ||||||
|
||||||
// Pick one of the bright color preset | ||||||
cy.get('[data-admin-theming-setting-primary-color-picker]').click() | ||||||
cy.get('.color-picker__simple-color-circle:eq(4)').click() | ||||||
|
||||||
cy.wait('@setColor') | ||||||
cy.waitUntil(() => validateBodyThemingCss('#ddcb55', '')) | ||||||
}) | ||||||
|
||||||
it('See the header being inverted', function() { | ||||||
cy.waitUntil(() => cy.window().then((win) => { | ||||||
const firstEntry = win.document.querySelector('.app-menu-main li') | ||||||
if (!firstEntry) { | ||||||
return false | ||||||
} | ||||||
return getComputedStyle(firstEntry).filter === 'invert(1)' | ||||||
})) | ||||||
}) | ||||||
}) | ||||||
|
||||||
describe('Change the login fields then reset them', function() { | ||||||
const name = 'ABCdef123' | ||||||
const url = 'https://example.com' | ||||||
const slogan = 'Testing is fun' | ||||||
|
||||||
before(function() { | ||||||
// Just in case previous test failed | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
cy.login(admin) | ||||||
}) | ||||||
|
||||||
|
@@ -196,7 +239,7 @@ describe('Change the login fields then reset them', function() { | |||||
}) | ||||||
|
||||||
it('Undo theming settings', function() { | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
}) | ||||||
|
||||||
it('Check login screen changes', function() { | ||||||
|
@@ -212,7 +255,7 @@ describe('Change the login fields then reset them', function() { | |||||
describe('Disable user theming and enable it back', function() { | ||||||
before(function() { | ||||||
// Just in case previous test failed | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
cy.login(admin) | ||||||
}) | ||||||
|
||||||
|
@@ -250,12 +293,12 @@ describe('User default option matches admin theming', function() { | |||||
|
||||||
before(function() { | ||||||
// Just in case previous test failed | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
cy.login(admin) | ||||||
}) | ||||||
|
||||||
after(function() { | ||||||
cy.resetTheming() | ||||||
cy.resetAdminTheming() | ||||||
}) | ||||||
|
||||||
it('See the admin theming section', function() { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is intentional.
We're in the admin section, we should use
defaultPrimaryColor
instead ofprimaryColor
If logged in, this var will be overruled below in the user section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain their differences ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultPrimaryColor
= admin defined, instance-wideprimaryColor
= user, active for current session