Skip to content

Commit

Permalink
Merge pull request #607 from newfold-labs/Press0-1769
Browse files Browse the repository at this point in the history
PRESS0-1769: Fix intermitent dark-light mode issue
  • Loading branch information
arunshenoy99 authored Aug 2, 2024
2 parents 60a559a + e690616 commit a4d11e0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ describe( 'SiteGen Fork Step', function() {
AdminBarCheck();
} );

it( 'Check for the existing dark background', () => {
DarkBGCheck();
it( 'Check for the default light background', () => {
LightBGCheck();
} );

it( 'Check for the light background', () => {
LightBGCheck();
it( 'Check for the dark background', () => {
DarkBGCheck();
} );


it( 'Check for the heading and the title', () => {
cy.get( '.nfd-onboarding-step__heading__title' )
.should( 'be.visible' )
Expand Down Expand Up @@ -120,8 +121,8 @@ describe( 'SiteGen Fork Step', function() {
).should( 'exist' );

AdminBarCheck();
DarkBGCheck();
LightBGCheck();
DarkBGCheck();
cy.wait( '@migrateCall', { timeout: waitTime } );
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ describe( 'SiteGen Site Details Step', function () {
AdminBarCheck();
} );

it( 'Check for the existing dark background', () => {
DarkBGCheck();
it( 'Check for the default light background', () => {
LightBGCheck();
} );

it( 'Check for the light background', () => {
LightBGCheck();
it( 'Check for the dark background', () => {
DarkBGCheck();
} );

it( 'Check the Progress Bar Value', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ describe( 'SiteGen Site Logo Step', function () {
AdminBarCheck();
} );

it( 'Check for the existing dark background', () => {
DarkBGCheck();
} );

it( 'Check for the light background', () => {
it( 'Check for the default light background', () => {
LightBGCheck();
} );

it( 'Check for the dark background', () => {
DarkBGCheck();
} );

it( 'Check the Progress Bar Value', () => {
ProgressBarCheck( '20%' );
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ describe( 'SiteGen Experience & Site Building Step', function () {
AdminBarCheck();
} );

it( 'Check for the existing dark background', () => {
DarkBGCheck();
it( 'Check for the default light background', () => {
LightBGCheck();
} );

it( 'Check for the light background', () => {
LightBGCheck();
it( 'Check for the dark background', () => {
DarkBGCheck();
} );

it( 'Check the Progress Bar Value', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ describe( 'SiteGen Site Editor Step', function () {
} );

it( 'Check if we cannot change to dark background', () => {
cy.get( '.nfd-onboarding-toggle__theme__button__light' ).should(
cy.get( '.nfd-onboarding-toggle__theme__button__dark' ).should(
'not.exist'
);
cy.get( '.nfd-onboarding-sitegen-dark' ).should( 'not.exist' );
} );

it( 'Check the Progress Bar Value', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/wp-module-support/MockApi.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ export const migrationConnection = ( req ) => {
method: 'GET',
statusCode: 200,
body: migrate_connect_mock,
delay: 8000,
delay: 13000,
} );
};
2 changes: 2 additions & 0 deletions tests/cypress/integration/wp-module-support/siteGen.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ export const DarkBGCheck = () => {
cy.get( '.nfd-onboarding-toggle__theme__button__light' )
.should( 'exist' )
.click();
cy.wait( 2000 );
cy.get( '.nfd-onboarding-sitegen-dark' ).should( 'be.visible' );
// Now changing the background back to light
cy.get( '.nfd-onboarding-toggle__theme__button__dark' )
.should( 'exist' )
.click();
cy.wait( 2000 );
cy.get( '.nfd-onboarding-sitegen-light' ).should( 'be.visible' );
};

Expand Down

0 comments on commit a4d11e0

Please sign in to comment.