add cypress tests for cardfeatures
Signed-off-by: grnd-alt <git@belakkaf.net>
This commit is contained in:
@@ -118,13 +118,13 @@ describe('Card', function() {
|
|||||||
cy.get('button.icon-folder').should('be.visible')
|
cy.get('button.icon-folder').should('be.visible')
|
||||||
.click()
|
.click()
|
||||||
cy.get('.file-picker__main').should('be.visible')
|
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()
|
.click()
|
||||||
cy.get('.dialog__actions button.button-vue--vue-primary').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.get('.card:contains("Hello world")').should('be.visible').click()
|
||||||
cy.intercept({ method: 'PUT', url: '**/apps/deck/cards/*' }).as('save')
|
cy.intercept({ method: 'PUT', url: '**/apps/deck/cards/*' }).as('save')
|
||||||
cy.get('.modal__card').should('be.visible')
|
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 .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.get('.reference-picker-modal--content .reference-picker button.button-vue--vue-primary').should('be.visible').click()
|
||||||
cy.wait('@save', { timeout: 7000 })
|
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.reload()
|
||||||
cy.get('.board .stack').eq(0).within(() => {
|
cy.get('.board .stack').eq(0).within(() => {
|
||||||
cy.get(`.card:contains("${newCardTitle}")`).should('be.visible')
|
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)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ export default {
|
|||||||
},
|
},
|
||||||
async cloneCard() {
|
async cloneCard() {
|
||||||
this.$store.dispatch('cloneCard', { cardId: this.card.id, targetStackId: this.selectedStack.id })
|
this.$store.dispatch('cloneCard', { cardId: this.card.id, targetStackId: this.selectedStack.id })
|
||||||
this.$store.dispatch('addCard', this.copiedCard)
|
|
||||||
this.modalShow = false
|
this.modalShow = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user