import {getMinimalMe} from '../../../support/helpers'; describe('Projects page', () => { const MeQuery = getMinimalMe({}); beforeEach(() => { cy.setup(); }); it('displays portfolio onboarding', () => { const operations = { MeQuery, ProjectsQuery: { projects: { edges: [], }, }, }; cy.mockGraphqlOps({ operations, }); cy.visit('/portfolio'); cy.getByDataCy('page-title').should('contain', 'Portfolio'); cy.getByDataCy('portfolio-onboarding-illustration').should('exist'); cy.getByDataCy('portfolio-onboarding-subtitle').should('contain', 'Woran denken Sie gerade'); cy.getByDataCy('portfolio-onboarding-text').should('contain', 'Hier können Sie Projekte erstellen'); cy.getByDataCy('page-footer').should('not.exist'); cy.getByDataCy('create-project-button').should('exist'); }); it('displays the project list', () => { const operations = { MeQuery, ProjectsQuery: { projects: { edges: [], }, }, }; cy.mockGraphqlOps({ operations, }); cy.visit('/portfolio'); cy.getByDataCy('page-title').should('contain', 'Portfolio'); cy.getByDataCy('create-project-button').should('exist'); cy.getByDataCy('project-list').should('exist'); cy.getByDataCy('project').should('have.length', 1); cy.getByDataCy('project-owner').should('contain', 'Bilbo Baggins'); }); });