fix: improve cert claiming test (#42989)
cy.intercept to ensure that the server has saved the submission should('not.exist') since the modal leaves the dom Co-authored-by: gikf <60067306+gikf@users.noreply.github.com> Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
77e6d0d0ed
commit
f4dc81bce3
@ -62,7 +62,13 @@ describe('Responsive Web Design Superblock', () => {
|
|||||||
cy.contains("I've completed this challenge")
|
cy.contains("I've completed this challenge")
|
||||||
.should('not.be.disabled')
|
.should('not.be.disabled')
|
||||||
.click();
|
.click();
|
||||||
|
cy.intercept('http://localhost:3000/project-completed').as(
|
||||||
|
'challengeCompleted'
|
||||||
|
);
|
||||||
cy.contains('Submit and go to next challenge').click();
|
cy.contains('Submit and go to next challenge').click();
|
||||||
|
cy.wait('@challengeCompleted')
|
||||||
|
.its('response.statusCode')
|
||||||
|
.should('eq', 200);
|
||||||
cy.location().should(loc => {
|
cy.location().should(loc => {
|
||||||
expect(loc.pathname).to.not.eq(url);
|
expect(loc.pathname).to.not.eq(url);
|
||||||
});
|
});
|
||||||
@ -74,7 +80,7 @@ describe('Responsive Web Design Superblock', () => {
|
|||||||
});
|
});
|
||||||
cy.get('.donation-modal').should('be.visible');
|
cy.get('.donation-modal').should('be.visible');
|
||||||
cy.contains('Ask me later').click();
|
cy.contains('Ask me later').click();
|
||||||
cy.get('.donation-modal').should('not.be.visible');
|
cy.get('.donation-modal').should('not.exist');
|
||||||
// directed to claim-cert-block section
|
// directed to claim-cert-block section
|
||||||
cy.url().should('include', '#claim-cert-block');
|
cy.url().should('include', '#claim-cert-block');
|
||||||
cy.contains('Claim Certification').should('not.be.disabled').click();
|
cy.contains('Claim Certification').should('not.be.disabled').click();
|
||||||
|
Reference in New Issue
Block a user