diff --git a/client/cypress/integration/solutions.spec.js b/client/cypress/integration/solutions.spec.js new file mode 100644 index 00000000..04cec8d4 --- /dev/null +++ b/client/cypress/integration/solutions.spec.js @@ -0,0 +1,17 @@ +describe('Solutions', () => { + it.only('does not display the solution at first, then displays them after clicking', () => { + cy.viewport('macbook-15'); + cy.login('rahel.cueni', 'test'); + + cy.visit('/module/lohn-und-budget'); + cy.get('[data-cy=solution]').first() + .should('contain', 'anzeigen').then($solution => { + cy.wrap($solution).within(() => { + cy.get('[data-cy=show-solution]').click(); + }); + cy.wrap($solution) + .should('contain', 'Lösungssatz') + .should('contain', 'ausblenden'); + }); + }); +}); diff --git a/client/src/components/ContentBlock.vue b/client/src/components/ContentBlock.vue index d1e1efca..e3aa0e5e 100644 --- a/client/src/components/ContentBlock.vue +++ b/client/src/components/ContentBlock.vue @@ -38,6 +38,7 @@ import LinkBlock from '@/components/content-blocks/LinkBlock'; import DocumentBlock from '@/components/content-blocks/DocumentBlock'; import Assignment from '@/components/content-blocks/assignment/Assignment'; + import Solution from '@/components/content-blocks/Solution'; import AddContentBlockButton from '@/components/AddContentBlockButton'; import VisibilityAction from '@/components/visibility/VisibilityAction'; import EyeIcon from '@/components/icons/EyeIcon'; @@ -58,6 +59,7 @@ 'video_block': VideoBlock, 'link_block': LinkBlock, 'document_block': DocumentBlock, + Solution, Assignment, Task, AddContentBlockButton, diff --git a/client/src/components/content-blocks/Solution.vue b/client/src/components/content-blocks/Solution.vue new file mode 100644 index 00000000..4dcfe3eb --- /dev/null +++ b/client/src/components/content-blocks/Solution.vue @@ -0,0 +1,26 @@ + + +