diff --git a/client/cypress/integration/frontend/read-only/portfolio.spec.js b/client/cypress/integration/frontend/read-only/portfolio.spec.js index 8eb73b66..31f345d5 100644 --- a/client/cypress/integration/frontend/read-only/portfolio.spec.js +++ b/client/cypress/integration/frontend/read-only/portfolio.spec.js @@ -1,7 +1,7 @@ import {getMinimalMe} from '../../../support/helpers'; -const getOperations = ({readOnly = false}) => ({ - MeQuery: getMinimalMe({readOnly}), +const getOperations = ({readOnly = false, classReadOnly = false}) => ({ + MeQuery: getMinimalMe({readOnly, classReadOnly}), ProjectsQuery: { projects: { edges: [ @@ -33,9 +33,17 @@ describe('Read Only Portfolio', () => { cy.getByDataCy('project-widget').should('have.length', 1); cy.getByDataCy('project-widget-actions').should('exist'); }); - it('Can not create and edit project', () => { + it('Can not create and edit project when license invalid', () => { cy.mockGraphqlOps({operations: getOperations({readOnly: true})}); + cy.visit('/portfolio'); + cy.getByDataCy('add-project-button').should('not.exist'); + cy.getByDataCy('project-widget').should('have.length', 1); + cy.getByDataCy('project-widget-actions').should('not.exist'); + }); + it('Can not create and edit project when class inactive', () => { + cy.mockGraphqlOps({operations: getOperations({readOnly: false, classReadOnly: true})}); + cy.visit('/portfolio'); cy.getByDataCy('add-project-button').should('not.exist'); cy.getByDataCy('project-widget').should('have.length', 1); diff --git a/client/cypress/integration/frontend/read-only/project.spec.js b/client/cypress/integration/frontend/read-only/project.spec.js index b27e1d64..3c318bac 100644 --- a/client/cypress/integration/frontend/read-only/project.spec.js +++ b/client/cypress/integration/frontend/read-only/project.spec.js @@ -1,7 +1,7 @@ import {getMinimalMe} from '../../../support/helpers'; -const getOperations = ({readOnly = false}) => ({ - MeQuery: getMinimalMe({readOnly}), +const getOperations = ({readOnly = false, classReadOnly = false}) => ({ + MeQuery: getMinimalMe({readOnly, classReadOnly}), ProjectQuery: { project: { id: 'projectId', @@ -21,8 +21,8 @@ const getOperations = ({readOnly = false}) => ({ }, }); -const testProject = (readOnly, shouldActionsExist) => { - cy.mockGraphqlOps({operations: getOperations({readOnly})}); +const testProject = (readOnly, shouldActionsExist, classReadOnly = false) => { + cy.mockGraphqlOps({operations: getOperations({readOnly, classReadOnly})}); const exist = shouldActionsExist ? 'exist' : 'not.exist'; @@ -42,7 +42,10 @@ describe('Read Only Project', () => { it('Can create and edit project entry', () => { testProject(false, true); }); - it('Can not create and edit project entry', () => { + it('Can not create and edit project entry when license expired', () => { testProject(true, false); }); + it('Can not create and edit project entry when class inactive', () => { + testProject(false, false, true); + }); }); diff --git a/client/src/pages/portfolio/portfolio.vue b/client/src/pages/portfolio/portfolio.vue index ef522fe4..3f956f83 100644 --- a/client/src/pages/portfolio/portfolio.vue +++ b/client/src/pages/portfolio/portfolio.vue @@ -3,13 +3,13 @@