Skip to content

Commit

Permalink
update before test to not wait on alias for fixture stubbed intercept
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Sep 19, 2023
1 parent 16e25bc commit 455293c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/cypress/integration/notifications.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ describe('Notifications', () => {
cy.intercept({
method: 'GET',
url: '**newfold-notifications**'
}, notifications ).as('notifications');
}, notifications );

cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/home', {timeout: 30000});
cy.wait('@notifications');

});

it('Is Accessible', () => {
Expand Down Expand Up @@ -129,12 +129,13 @@ describe('Notifications', () => {

// dismiss events triggered
it('Dismissing notification removes it from the page', () => {

cy.intercept({
method: 'DELETE',
url: /newfold-notifications(\/|%2F)v1(\/|%2F)notifications/
method: 'POST',
url: '**newfold-notifications**',
}, {
body: {"id":"test-2"}
}).as('notificationDismiss');
body: {"id":"test-2"}
} ).as('dismissNotificaiton');

cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/home');

Expand All @@ -151,8 +152,8 @@ describe('Notifications', () => {


cy.get('#notification-test-2 button.notice-dismiss[data-action="close"]').click();
// cy.wait('@notificationDismiss');
cy.wait(2000);
cy.wait('@dismissNotificaiton');
cy.get('.newfold-notifications-wrapper #notification-test-2')
.should('not.exist');

Expand Down

0 comments on commit 455293c

Please sign in to comment.