Skip to content

Commit

Permalink
test(cy): Fix ImageView native tests
Browse files Browse the repository at this point in the history
Use `createFile` instead of `createMarkdown` in `before()` block. No
idea why, but it fixes the tests reliably.

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- authored and backportbot[bot] committed Sep 15, 2024
1 parent 91f982a commit 3a1005b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cypress/e2e/nodes/ImageView.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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`)
Expand Down

0 comments on commit 3a1005b

Please sign in to comment.