From 9c027b0d7a85b01d2e8d44b4d4faec55796ad6d4 Mon Sep 17 00:00:00 2001 From: Misha Hrynko Date: Wed, 11 Oct 2023 12:06:56 +0300 Subject: [PATCH] fix toggle error test --- cypress/integration/page.spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/integration/page.spec.js b/cypress/integration/page.spec.js index 4f8ba1046c..476f85dab9 100644 --- a/cypress/integration/page.spec.js +++ b/cypress/integration/page.spec.js @@ -1085,7 +1085,11 @@ describe('', () => { }); it('should not hide a todo on fail', () => { - page.mockUpdate(257334).as('updateRequest'); + // to prevent Cypress from failing the test on uncaught exception + cy.once('uncaught:exception', () => false); + + page.mockUpdate(257334, { statusCode: 503, body: 'Service Unavailable' }) + .as('updateRequest'); todos.statusToggler(0).click(); cy.wait('@updateRequest');