From aaa3356293c397300f341fec987ee405d0291c3a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 1 Feb 2024 17:40:27 -0500 Subject: [PATCH 1/2] add alias to intercept --- tests/cypress/integration/notifications.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/integration/notifications.cy.js b/tests/cypress/integration/notifications.cy.js index 60fd65f..dcccf23 100644 --- a/tests/cypress/integration/notifications.cy.js +++ b/tests/cypress/integration/notifications.cy.js @@ -76,7 +76,7 @@ describe( 'Notifications', () => { url: /newfold-notifications(\/|%2F)v1(\/|%2F)notifications/, }, notifications - ); + ).as('notifications'); cy.visit( '/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) + '#/home', From e8ff0fbe435c45233666ea46d51b737bb7f287c4 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 1 Feb 2024 17:48:05 -0500 Subject: [PATCH 2/2] clear notification transient before --- tests/cypress/integration/notifications.cy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cypress/integration/notifications.cy.js b/tests/cypress/integration/notifications.cy.js index dcccf23..5e9bc0e 100644 --- a/tests/cypress/integration/notifications.cy.js +++ b/tests/cypress/integration/notifications.cy.js @@ -70,13 +70,14 @@ describe( 'Notifications', () => { const appClass = '.' + Cypress.env( 'appId' ); before( () => { + cy.exec( 'npx wp-env run cli wp transient delete newfold_notifications' ); cy.intercept( { method: 'GET', url: /newfold-notifications(\/|%2F)v1(\/|%2F)notifications/, }, notifications - ).as('notifications'); + ).as( 'notifications' ); cy.visit( '/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) + '#/home',