Skip to content

Commit

Permalink
Fix a couple of stub assertions in AuthorCard.cy.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mikiher committed Apr 17, 2024
1 parent 9e1c907 commit a49c5af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/components/cards/AuthorCard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand All @@ -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')
})
Expand All @@ -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')
}
Expand All @@ -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')
})
Expand Down

0 comments on commit a49c5af

Please sign in to comment.