diff --git a/client/cypress/integration/frontend/modules/assignment-in-module.spec.js b/client/cypress/integration/frontend/modules/assignment-in-module.spec.js new file mode 100644 index 00000000..913fcb6e --- /dev/null +++ b/client/cypress/integration/frontend/modules/assignment-in-module.spec.js @@ -0,0 +1,77 @@ +import {getMinimalMe} from '../../../support/helpers'; + +// const operations = { +// MeQuery: getMinimalMe({isTeacher: false}), +// }; +const MeQuery = getMinimalMe(); + +describe('Content Blocks', () => { + const slug = 'some-module'; + const assignment = { + id: 'abc', + title: 'Some assignment', + assignment: 'Please write down your thoughts', + submission: null, + }; + const module = { + title: 'Hello world', + slug, + solutionsEnabled: false, + chapters: [{ + contentBlocks: [ + { + title: 'A content block', + contents: [ + { + type: 'text_block', + value: { + text: 'Ein Text', + }, + }, + { + type: 'assignment', + value: assignment, + }, + ], + }, + ], + }], + }; + const operations = { + ModuleDetailsQuery: { + module, + }, + MeQuery, + ModuleEditModeQuery: { + module: { + slug, + }, + }, + UpdateLastModule: { + module, + }, + AssignmentQuery: { + assignment, + }, + UpdateAssignmentWithSuccess: { + updateAssignment: { + successful: true, + updatedAssignment: assignment + }, + }, + }; + beforeEach(() => { + cy.setup(); + cy.mockGraphqlOps({operations}); + cy.visit(`module/${slug}`); + }); + + it('types into the assignment input', () => { + cy.getByDataCy('submission-textarea').should('exist').type('My Solution'); + }); + + it('does not see assignment input on mobile', () => { + cy.viewport('iphone-8'); + cy.getByDataCy('submission-textarea').should('not.be.visible'); + }); +}); diff --git a/client/cypress/integration/frontend/modules/custom-content-block.spec.js b/client/cypress/integration/frontend/modules/custom-content-block.spec.js index 0b415197..21bf98c8 100644 --- a/client/cypress/integration/frontend/modules/custom-content-block.spec.js +++ b/client/cypress/integration/frontend/modules/custom-content-block.spec.js @@ -9,7 +9,14 @@ const chapters = [{ title: 'A ContentBlock', userCreated: true, mine: true, - contents: [], + contents: [ + { + type: 'text_block', + value: { + text: 'Hello World' + } + } + ], }, ], }]; @@ -21,6 +28,11 @@ const operations = { chapters, }, }, + ModuleEditModeQuery: { + module: { + slug: 'some-module', + } + }, DeleteContentBlock: { success: true, }, @@ -32,6 +44,7 @@ describe('Custom Content Block', () => { cy.setup(); }); + // todo: fix this test it.skip('Deletes the custom content block and removes it from the view', () => { cy.mockGraphqlOps({ operations, diff --git a/client/cypress/integration/frontend/portfolio/project-page.spec.js b/client/cypress/integration/frontend/portfolio/project-page.spec.js index cf4c3f82..b58f94d8 100644 --- a/client/cypress/integration/frontend/portfolio/project-page.spec.js +++ b/client/cypress/integration/frontend/portfolio/project-page.spec.js @@ -184,9 +184,14 @@ describe('Project Page', () => { cy.getByDataCy('project-entry-more').should('not.exist'); }); + it('does not show button on mobile', () => { + cy.viewport('iphone-8'); + cy.getByDataCy('project-title').should('exist'); + cy.getByDataCy('add-project-entry').should('not.exist'); + }); + describe('Project Entry', () => { - // todo: this test fails half of the time in pipelines, fix and re-enable - it.skip('should create a new project entry', () => { + it('should create a new project entry', () => { cy.visit('/portfolio'); cy.get('[data-cy=project-link]:first-of-type').click(); cy.get('[data-cy=add-project-entry]:first-of-type').click(); @@ -237,6 +242,14 @@ describe('Project Page', () => { cy.getByDataCy('use-template-button').click(); cy.getByDataCy('project-entry-textarea').should('have.value', PROJECT_ENTRY_TEMPLATE); }); + + it('should not display the entry actions on mobile', () => { + cy.viewport('iphone-8') ; + cy.visit('/portfolio/groot'); + cy.getByDataCy('project-entry').should('exist'); + cy.getByDataCy('project-entry-more').should('not.be.visible'); + cy.getByDataCy('project-actions').should('not.be.visible'); + }); }); }) ; diff --git a/client/cypress/integration/frontend/portfolio/projects-page.spec.js b/client/cypress/integration/frontend/portfolio/projects-page.spec.js index 9d4635df..c51b6cf2 100644 --- a/client/cypress/integration/frontend/portfolio/projects-page.spec.js +++ b/client/cypress/integration/frontend/portfolio/projects-page.spec.js @@ -83,7 +83,6 @@ describe('Projects page', () => { ], }, AddProject: variables => { - console.log(variables); const {input: {project}} = variables; return { addProject: { @@ -110,4 +109,20 @@ describe('Projects page', () => { cy.getByDataCy('project').should('have.length', 2); }); + + it('does not display button on mobile', () => { + const operations = { + MeQuery, + ProjectsQuery: { + projects: [], + }, + }; + cy.mockGraphqlOps({ + operations, + }); + cy.viewport('iphone-8'); + + cy.getByDataCy('page-title').should('exist'); + cy.getByDataCy('create-project-button').should('not.be.visible'); + }); }); diff --git a/client/cypress/integration/frontend/rooms/article-page.spec.js b/client/cypress/integration/frontend/rooms/article-page.spec.js index 692b9101..5ef7e1d3 100644 --- a/client/cypress/integration/frontend/rooms/article-page.spec.js +++ b/client/cypress/integration/frontend/rooms/article-page.spec.js @@ -69,4 +69,14 @@ describe('Article page', () => { cy.getByDataCy('submit-comment').should('contain', 'Kommentar teilen').click(); cy.getByDataCy('comment').first().should('contain', commentText + emoji); }); + + it('does not show input field on mobile', () => { + cy.mockGraphqlOps({ + operations, + }); + cy.viewport('iphone-8'); + cy.visit(`/article/${slug}`); + cy.getByDataCy('article-title').should('exist'); + cy.getByDataCy('comment-textarea').should('not.be.visible'); + }); }); diff --git a/client/cypress/integration/frontend/rooms/room-page.spec.js b/client/cypress/integration/frontend/rooms/room-page.spec.js index bad29605..78895913 100644 --- a/client/cypress/integration/frontend/rooms/room-page.spec.js +++ b/client/cypress/integration/frontend/rooms/room-page.spec.js @@ -383,6 +383,21 @@ describe('The Room Page (student)', () => { cy.getByDataCy('room-entry').should('have.length', 1).within(() => { cy.getByDataCy('entry-count').should('contain.text', '2'); }); + }); + it('does not show actions on mobile', () => { + const operations = { + MeQuery, + RoomEntriesQuery, + }; + cy.mockGraphqlOps({ + operations, + }); + cy.viewport('iphone-8'); + + cy.visit(`/room/${slug}`); + cy.getByDataCy('room-actions').should('not.exist'); + cy.getByDataCy('room-entry').should('have.length', 1); + cy.getByDataCy('room-entry-actions').should('not.be.visible'); }); }); diff --git a/client/src/components/book-navigation/ContentNavigation.vue b/client/src/components/book-navigation/ContentNavigation.vue index c8362b54..0b3f57c3 100644 --- a/client/src/components/book-navigation/ContentNavigation.vue +++ b/client/src/components/book-navigation/ContentNavigation.vue @@ -15,7 +15,7 @@ {{ $flavor.textTopics }} - @@ -97,7 +97,7 @@ - - diff --git a/client/src/pages/portfolio/portfolio.vue b/client/src/pages/portfolio/portfolio.vue index 74b55822..727656af 100644 --- a/client/src/pages/portfolio/portfolio.vue +++ b/client/src/pages/portfolio/portfolio.vue @@ -79,8 +79,11 @@ padding: $large-spacing $medium-spacing; &__create-button { - display: inline-flex; + display: none; width: 150px; + @include desktop { + display: inline-flex; + } } &__page { diff --git a/client/src/pages/portfolio/project.vue b/client/src/pages/portfolio/project.vue index bc332df2..3cb33bdb 100644 --- a/client/src/pages/portfolio/project.vue +++ b/client/src/pages/portfolio/project.vue @@ -164,6 +164,13 @@ justify-self: end; } + &__more { + display: none; + @include desktop { + display: block; + } + } + &__share { margin-right: $medium-spacing; } @@ -179,6 +186,11 @@ &__add-entry { height: 120px; + + display: none; + @include desktop { + display:flex; + } } &__description { diff --git a/client/src/pages/topic-page.vue b/client/src/pages/topic-page.vue index 47acb63c..c9d67c28 100644 --- a/client/src/pages/topic-page.vue +++ b/client/src/pages/topic-page.vue @@ -1,7 +1,7 @@