Skip to content

Commit

Permalink
test: Add cypress test for inline editing the card title
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Jan 14, 2025
1 parent fa23a38 commit be748f5
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions cypress/e2e/cardFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,47 @@ describe('Card', function () {
.find('h2').contains('Example Domain').should('be.visible')
})

it('Rename card with link', () => {
cy.visit(`/apps/deck/#/board/${boardId}`)
const absoluteUrl = `https://example.com`
const plainTitle = 'New title'
cy.get('.board .stack').eq(0).within(() => {
cy.get('.button-vue[aria-label*="Add card"]')
.first().click()

cy.get('.stack__card-add form input#new-stack-input-main')
.type(absoluteUrl)
cy.get('.stack__card-add form input[type=submit]')
.first().click()
cy.get('.card:contains("Example Domain")')
.should('be.visible')
})

// Rename link to plain title
cy.get('.card:contains("Example Domain")')
.find('.action-item__menutoggle')
.click()
cy.get('.v-popper__popper button:contains("Edit title")')
.click()
cy.get(`h4:contains("${absoluteUrl}") span[contenteditable="true"]`)
.type(`{selectAll}${plainTitle}{enter}`)
cy.get(`.card:contains("${plainTitle}")`)
.should('be.visible')

// Rename plain title to link
cy.get('.card:contains("New title")')
.find('.action-item__menutoggle')
.click()
cy.get('.v-popper__popper button:contains("Edit title")')
.click()
cy.get('h4:contains("New title") span[contenteditable="true"]')
.type(`{selectAll}${absoluteUrl}{enter}`)
cy.get('.board').click()
cy.get('.card:contains("Example Domain")')
.should('be.visible')

})

describe('Modal', () => {
beforeEach(function () {
cy.login(user)
Expand Down

0 comments on commit be748f5

Please sign in to comment.