Skip to content

Commit

Permalink
Fix cypress intercept
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-vara committed Aug 16, 2024
1 parent df1f906 commit c5d2410
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion assets/js/realtime-notices.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@
}
)
.then(response => {
return response;
if (response.status !== 201) {
throw new Error(response.statusText);
}
Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/integration/plugin-search.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const notifications = {
};

describe('Plugin Search', () => {
const appClass = '.' + Cypress.env('appId');

before(() => {
cy.exec('npx wp-env run cli wp transient delete newfold_notifications', { failOnNonZeroExit: false });
Expand All @@ -47,7 +46,10 @@ describe('Plugin Search', () => {
method: 'POST',
url: /newfold-notifications(\/|%2F)v1(\/|%2F)notifications(\/|%2F)events/,
},
notifications
{
statusCode: 201,
body: notifications,
}
).as('notifications');


Expand Down
10 changes: 8 additions & 2 deletions tests/cypress/integration/theme-search.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ describe('Theme Search', () => {
method: 'POST',
url: /newfold-notifications(\/|%2F)v1(\/|%2F)notifications(\/|%2F)events/,
},
notifications
{
statusCode: 201,
body: notifications,
}
).as('notifications');

cy.wait('@notifications');
Expand All @@ -65,7 +68,10 @@ describe('Theme Search', () => {
method: 'POST',
url: /newfold-notifications(\/|%2F)v1(\/|%2F)notifications(\/|%2F)events/,
},
notifications
{
statusCode: 201,
body: notifications,
}
).as('notifications');

cy.wait('@notifications');
Expand Down

0 comments on commit c5d2410

Please sign in to comment.