Fix cypress tests

This commit is contained in:
Ramon Wenger 2022-10-17 16:08:47 +02:00
parent a17db3f289
commit 442a50e29d
1 changed files with 6 additions and 2 deletions

View File

@ -155,14 +155,17 @@ describe('Project Page', () => {
cy.mockGraphqlOps({
operations: getOperationsForSharing,
});
cy.visit('/portfolio/groot');
const unsharedText = 'Mit Lehrperson teilen';
const sharedText = 'Nicht mehr teilen';
cy.visit('/portfolio/groot');
cy.getByDataCy('project-title').contains('Groot'); // sanity check, make sure the page is fully loaded
cy.getByDataCy('project-share-link').should('contain', unsharedText);
cy.getByDataCy('project-share-link').click();
cy.getByDataCy('project-title').contains('Groot'); // sanity check, make sure the page is fully loaded
cy.getByDataCy('project-share-link').should('contain', sharedText);
cy.getByDataCy('project-share-link').click();
cy.getByDataCy('project-title').contains('Groot'); // sanity check, make sure the page is fully loaded
cy.getByDataCy('project-share-link').should('contain', unsharedText);
});
@ -203,6 +206,7 @@ describe('Project Page', () => {
cy.getByDataCy('use-template-button').should('exist').click();
cy.getByDataCy('upload-document-button').should('exist');
cy.getByDataCy('modal-save-button').click();
cy.get('.modal').should('not.exist'); // make sure the modal is closed
cy.get('.project-entry:last-of-type').within(() => {
cy.get('.project-entry__paragraph:first-of-type').contains('Schwierigkeiten');