add cypress tests for cardfeatures

Signed-off-by: grnd-alt <git@belakkaf.net>
This commit is contained in:
grnd-alt
2024-11-25 13:56:03 +01:00
committed by Julius Knorr
parent 2e0f0d29b6
commit 0a48954f18
2 changed files with 29 additions and 17 deletions

View File

@@ -118,13 +118,13 @@ describe('Card', function() {
cy.get('button.icon-folder').should('be.visible')
.click()
cy.get('.file-picker__main').should('be.visible')
cy.get('.file-picker__main [data-filename="welcome.txt"]', { timeout: 30000 }).should('be.visible')
cy.get('.file-picker__main [data-filename="Nextcloud_Server_Administration_Manual.pdf"]', { timeout: 30000 }).should('be.visible')
.click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()
cy.get('.attachment-list .basename').contains('welcome.txt')
cy.get('.attachment-list .basename').contains('Nextcloud_Server_Administration_Manual.pdf')
})
it.only('Shows the modal with the editor', () => {
it('Shows the modal with the editor', () => {
cy.get('.card:contains("Hello world")').should('be.visible').click()
cy.intercept({ method: 'PUT', url: '**/apps/deck/cards/*' }).as('save')
cy.get('.modal__card').should('be.visible')
@@ -161,9 +161,9 @@ describe('Card', function() {
cy.get('.reference-picker-modal--content .reference-picker .multiselect-list').should('be.visible').contains(boardData.stacks[0].title)
cy.get('.reference-picker-modal--content .reference-picker button.button-vue--vue-primary').should('be.visible').click()
cy.wait('@save', { timeout: 7000 })
cy.get('.modal__card .ProseMirror').contains('/index.php/apps/deck/card/').should('be.visible')
cy.get('.modal__card .ProseMirror').contains('/index.php/apps/deck/card/').should('have.length', 1)
cy.visit(`/apps/deck/#/board/${boardId}`)
cy.visit(`/apps/deck/board/${boardId}`)
cy.reload()
cy.get('.board .stack').eq(0).within(() => {
cy.get(`.card:contains("${newCardTitle}")`).should('be.visible')
@@ -298,5 +298,18 @@ describe('Card', function() {
})
})
})
it('clone card', () => {
cy.intercept({ method: 'POST', url: '**/apps/deck/cards/*/clone' }).as('clone')
cy.get('.card:contains("Hello world")').should('be.visible').click()
cy.get('#app-sidebar-vue')
.find('.ProseMirror h1').contains('Hello world').should('be.visible')
cy.get('.app-sidebar-header .action-item__menutoggle').click()
cy.get('.v-popper__popper button:contains("Clone card")').click()
cy.get('.modal__content button:contains("Clone card")').click()
cy.wait('@clone', { timeout: 7000 })
cy.get('.card:contains("Hello world")').should('have.length', 2)
})
})
})

View File

@@ -91,7 +91,6 @@ export default {
},
async cloneCard() {
this.$store.dispatch('cloneCard', { cardId: this.card.id, targetStackId: this.selectedStack.id })
this.$store.dispatch('addCard', this.copiedCard)
this.modalShow = false
},
},