Skip to content

Commit

Permalink
Merge pull request #11 from newfold-labs/update/test
Browse files Browse the repository at this point in the history
update before test to not wait on alias for fixture stubbed intercept
  • Loading branch information
circlecube authored Sep 19, 2023
2 parents 16e25bc + 455293c commit 042b1ca
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 042b1ca

Please sign in to comment.