From f45be78ac6e6d1f779ef08ec51d3012d3d32dc31 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Wed, 15 May 2024 11:23:10 +0200 Subject: [PATCH] Fix flaky spellcheck test --- client/cypress/e2e/frontend/spellcheck.spec.js | 3 +-- client/cypress/fixtures/mocks.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/cypress/e2e/frontend/spellcheck.spec.js b/client/cypress/e2e/frontend/spellcheck.spec.js index 1b459b7b..80aec1f1 100644 --- a/client/cypress/e2e/frontend/spellcheck.spec.js +++ b/client/cypress/e2e/frontend/spellcheck.spec.js @@ -7,7 +7,7 @@ const userText = 'Hir ist ein Feler gewesen'; const operations = { MeQuery: { me: { - permissions: [], + isTeacher: false, readOnly: false, }, }, @@ -142,7 +142,6 @@ describe('Spellcheck', () => { }); }); - // todo: unskip me it('should highlight three errors', () => { cy.visit('/module/lohn-und-budget/'); diff --git a/client/cypress/fixtures/mocks.ts b/client/cypress/fixtures/mocks.ts index ae8d87e3..6868ff96 100644 --- a/client/cypress/fixtures/mocks.ts +++ b/client/cypress/fixtures/mocks.ts @@ -30,6 +30,10 @@ const getModuleId = () => moduleIdIterator.next().value; const getContentBlockId = () => contentBlockIdIterator.next().value; const getInstrumentId = () => instrumentIdGenerator.next().value; +// small base64 image that looks like a transparent background in photoshop +const smallImage = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII'; + export default { UUID: () => '123-456-789', GenericStreamFieldType: () => ({ type: 'text_block', value: 'Generic Stream Field Type' }), @@ -66,6 +70,10 @@ export default { solution: 'Assignment Solution', }), PrivateUserNode: () => ({ + firstName: '', + lastName: '', + username: 'user', + avatarUrl: smallImage, readOnly: false, onboardingVisited: true, selectedClass, @@ -93,8 +101,7 @@ export default { title: '', width: 800, height: 400, - // small base64 image that looks like a transparent background in photoshop - src: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII', + src: smallImage, alt: '', }, heroSource: '',