From 3a1005b628ce20bc645c33bad1c20b74975f19a6 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sat, 14 Sep 2024 23:58:37 +0200 Subject: [PATCH] test(cy): Fix ImageView native tests Use `createFile` instead of `createMarkdown` in `before()` block. No idea why, but it fixes the tests reliably. Signed-off-by: Jonas --- cypress/e2e/nodes/ImageView.spec.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/nodes/ImageView.spec.js b/cypress/e2e/nodes/ImageView.spec.js index 38832c1ef4a..7af7849d25c 100644 --- a/cypress/e2e/nodes/ImageView.spec.js +++ b/cypress/e2e/nodes/ImageView.spec.js @@ -16,6 +16,7 @@ describe('Image View', () => { cy.createFolder('child-folder') cy.uploadFile('github.png', 'image/png') cy.uploadFile('github.png', 'image/png', 'child-folder/github.png') + }) beforeEach(() => { @@ -110,11 +111,8 @@ describe('Image View', () => { describe('native attachments', () => { before(() => { cy.login(user) - cy.visit('/apps/files') const fileName = 'native attachments.md' - cy.createMarkdown(fileName, '# open image in modal\n\n ![git](.attachments.123/github.png)\n\n ![file.txt.gz](.attachments.123/file.txt.gz)') - - cy.getFileId(fileName).then((fileId) => { + cy.createFile(fileName, '# open image in modal\n\n ![git](.attachments.123/github.png)\n\n ![file.txt.gz](.attachments.123/file.txt.gz)').then((fileId) => { const attachmentsFolder = `.attachments.${fileId}` cy.createFolder(attachmentsFolder) cy.uploadFile('github.png', 'image/png', `${attachmentsFolder}/github.png`)