- cy.loginAs(activeUser);
- cy.doSearch(`${activeUser.user.uuid}`);
- cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
- cy.get('[data-cy=breadcrumb-last]').should('not.exist');
- // Create new project
- const projName = `Test project (${Math.floor(999999 * Math.random())})`;
- createProject(projName, 'Home project');
- // Confirm that the user was taken to the newly created thing
- cy.get('[data-cy=form-dialog]').should('not.exist');
- cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
- cy.get('[data-cy=breadcrumb-last]').should('contain', projName);
- // Create a subproject
- const subProjName = `Test project (${Math.floor(999999 * Math.random())})`;
- createProject(subProjName, projName);
- cy.get('[data-cy=form-dialog]').should('not.exist');
- cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
- cy.get('[data-cy=breadcrumb-last]').should('contain', subProjName);
- })
-})
\ No newline at end of file
+ cy.getAll('@mySharedWritableProject')
+ .then(function ([mySharedWritableProject]) {
+ cy.loginAs(activeUser);
+
+ cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
+
+ const newProjectName = `New project name ${mySharedWritableProject.name}`;
+ const newProjectDescription = `New project description ${mySharedWritableProject.name}`;
+
+ cy.testEditProjectOrCollection('[data-cy=side-panel-tree]', mySharedWritableProject.name, newProjectName, newProjectDescription);
+ });
+ });
+
+ it('side panel react to refresh when project data changes', () => {
+ const project = 'writableProject';
+
+ cy.createProject({
+ owningUser: activeUser,
+ targetUser: activeUser,
+ projectName: project,
+ canWrite: true,
+ addToFavorites: false
+ });
+
+ cy.getAll('@writableProject').then(function ([writableProject]) {
+ cy.loginAs(activeUser);
+ cy.get('[data-cy=side-panel-tree]')
+ .contains('Projects').click();
+ cy.get('[data-cy=side-panel-tree]')
+ .contains(writableProject.name).should('exist');
+ cy.trashGroup(activeUser.token, writableProject.uuid).then(() => {
+ cy.contains('Refresh').click();
+ cy.contains(writableProject.name).should('not.exist');
+ });
+ });
+ });
+})