From a49c5afa46505a16a41c61e2a57ff5192600259c Mon Sep 17 00:00:00 2001 From: mikiher Date: Wed, 17 Apr 2024 23:22:21 +0300 Subject: [PATCH] Fix a couple of stub assertions in AuthorCard.cy.js --- client/components/cards/AuthorCard.cy.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/components/cards/AuthorCard.cy.js b/client/components/cards/AuthorCard.cy.js index 0f78229ef9..88d13cbade 100644 --- a/client/components/cards/AuthorCard.cy.js +++ b/client/components/cards/AuthorCard.cy.js @@ -153,7 +153,7 @@ describe('AuthorCard', () => { $post: cy.stub().resolves({ updated: true, author: { name: 'John Doe' } }) }, $toast: { - success: cy.stub().withArgs('Author John Doe was updated (no image found)').as('success'), + success: cy.stub().as('success'), error: cy.spy().as('error'), info: cy.spy().as('info') } @@ -163,7 +163,7 @@ describe('AuthorCard', () => { cy.get('#match').click() cy.get("#spinner").should('be.hidden') - cy.get('@success').should('have.been.called') + cy.get('@success').should('have.been.calledOnceWithExactly', 'Author John Doe was updated (no image found)') cy.get('@error').should('not.have.been.called') cy.get('@info').should('not.have.been.called') }) @@ -175,7 +175,7 @@ describe('AuthorCard', () => { $post: cy.stub().resolves({ updated: true, author: { name: 'John Doe', imagePath: "path/to/image" } }) }, $toast: { - success: cy.stub().withArgs('Author John Doe was updated').as('success'), + success: cy.stub().as('success'), error: cy.spy().as('error'), info: cy.spy().as('info') } @@ -185,7 +185,7 @@ describe('AuthorCard', () => { cy.get('#match').click() cy.get("#spinner").should('be.hidden') - cy.get('@success').should('have.been.called') + cy.get('@success').should('have.been.calledOnceWithExactly', 'Author John Doe was updated') cy.get('@error').should('not.have.been.called') cy.get('@info').should('not.have.been.called') })