Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Jan 17, 2024
1 parent cc432b3 commit c735333
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions tests/cypress/integration/coming-soon.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,38 @@ describe( 'Coming Soon', function () {

before( () => {
// Set coming soon to true
cy.exec( `npx wp-env run cli wp option update nfd_coming_soon true` );
cy.exec( 'npx wp-env run cli wp option update nfd_coming_soon true' );
} );

// skip this test since it is not true on some brand plugins.
it( 'Has Coming Soon Section on Home', () => {
cy.visit(
'/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) + '#/home'
);
cy.get( appClass + '-home .nfd-app-section-content' )
.first()
.scrollIntoView()
.contains( 'h1', 'Ready to go live?' )
.should( 'be.visible' );

cy.get( appClass + '-home .nfd-app-section-content' )
.contains( 'a.nfd-button', 'iew your s' )
.first()
.should( 'exist' );

cy.get( appClass + '-home .nfd-app-section-content' )
.first()
.contains( 'button', 'Launch' )
.should( 'exist' );
} );

it( 'Coming Soon Toggle Functions', () => {
cy.visit(
'/wp-admin/admin.php?page=' +
Cypress.env( 'pluginId' ) +
'#/settings'
);
cy.injectAxe();
} );

it( 'Coming Soon Toggle Functions', () => {
// Initial Coming Soon State
cy.get( '#wp-toolbar #wp-admin-bar-site-status' )
.contains( 'span', 'Coming Soon' )
Expand Down Expand Up @@ -75,27 +96,6 @@ describe( 'Coming Soon', function () {
.should( 'be.visible' );
} );

it( 'Has Coming Soon Section on Home', () => {
cy.visit(
'/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) + '#/home'
);
cy.get( appClass + '-home .nfd-app-section-content' )
.first()
.scrollIntoView()
.contains( 'h1', 'Ready to go live?' )
.should( 'be.visible' );

cy.get( appClass + '-home .nfd-app-section-content' )
.contains( 'a.nfd-button', 'iew your s' )
.first()
.should( 'exist' );

cy.get( appClass + '-home .nfd-app-section-content' )
.first()
.contains( 'button', 'Launch' )
.should( 'exist' );
} );

it( 'Displays admin coming soon notice', () => {
cy.visit( '/wp-admin/index.php' );
cy.get( '.notice-warning' )
Expand Down

0 comments on commit c735333

Please sign in to comment.