Skip to content

Commit

Permalink
enh(cy): test create new text attachment from toolbar
Browse files Browse the repository at this point in the history
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Dec 17, 2024
1 parent 4647545 commit 21ce355
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cypress/e2e/attachments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const attachmentFileNameToId = {}

const ACTION_UPLOAD_LOCAL_FILE = 'insert-attachment-upload'
const ACTION_INSERT_FROM_FILES = 'insert-attachment-insert'
const ACTION_CREATE_NEW_TEXT_FILE = 'insert-attachment-add-text-0'

/**
* @param {string} name name of file
Expand Down Expand Up @@ -279,6 +280,19 @@ describe('Test all attachment insertion methods', () => {
cy.closeFile()
})

it('Create a new text file as an attachment', () => {
cy.visit('/apps/files')
cy.openFile('test.md')

cy.log('Create a new text file as an attachment')
const requestAlias = 'create-attachment-request'
cy.intercept({ method: 'POST', url: '**/text/attachment/create' }).as(requestAlias)
clickOnAttachmentAction(ACTION_CREATE_NEW_TEXT_FILE)
.then(() => {
return waitForRequestAndCheckAttachment(requestAlias, undefined, false)
})
})

it('test if attachment files are in the attachment folder', () => {
cy.visit('/apps/files')

Expand Down

0 comments on commit 21ce355

Please sign in to comment.