Add cypress test for project entry deletion

This commit is contained in:
Ramon Wenger 2019-05-21 14:42:06 +02:00
parent 735d2d9afa
commit 7bc8c3c3aa
1 changed files with 14 additions and 1 deletions

View File

@ -40,5 +40,18 @@ describe('Project Entry', () => {
cy.get('[data-cy=modal-save-button]').click();
cy.waitFor('UpdateProjectEntry');
cy.get('.project-entry__paragraph:first-of-type').contains('Defeat Thanos');
})
});
it('should delete the last entry', () => {
cy.visit('/portfolio/groot');
cy.get('.project-entry').should('have.length', 2);
cy.get('.project-entry:last-of-type').within(() => {
cy.get('[data-cy=project-entry-more]').click();
cy.get('[data-cy=delete-project-entry]').click();
});
cy.get('.project-entry').should('have.length', 1);
});
});