diff --git a/cypress/e2e/deckDashboard.js b/cypress/e2e/deckDashboard.js index aedccc2a2..eb8a0dd75 100644 --- a/cypress/e2e/deckDashboard.js +++ b/cypress/e2e/deckDashboard.js @@ -1,4 +1,5 @@ import { randUser } from '../utils/index.js' +import { sampleBoard } from '../utils/sampleBoard' const user = randUser() describe('Deck dashboard', function() { @@ -8,16 +9,18 @@ describe('Deck dashboard', function() { beforeEach(function() { cy.login(user) - cy.visit('/apps/deck') }) it('Can show the right title on the dashboard', function() { + cy.visit('/apps/deck') cy.get('.board-title h2') .should('have.length', 1).first() .should($el => expect($el.text().trim()).to.equal('Upcoming cards')) }) it('Can see the default "Personal Board" created for user by default', function() { + cy.visit('/apps/deck') + const defaultBoard = 'Personal' cy.get('.app-navigation-entry-wrapper[icon=icon-deck]') @@ -26,4 +29,29 @@ describe('Deck dashboard', function() { .contains(defaultBoard) .should('be.visible') }) + + it('Shows a card with due date on the overview', function() { + cy.createExampleBoard({ + user, + board: sampleBoard(), + }).then((board) => { + cy.visit(`/apps/deck/#/board/${board.id}`) + + cy.intercept({ method: 'PUT', url: '**/apps/deck/cards/**' }).as('updateCard') + + const newCardTitle = 'Hello world' + cy.get(`.card:contains("${newCardTitle}")`).should('be.visible').click() + cy.get('#app-sidebar-vue [data-cy-due-date-actions]').should('be.visible').click() + cy.get('[data-cy-due-date-shortcut="tomorrow"] button').should('be.visible').click() + + cy.wait('@updateCard') + + cy.get('button[title="Close sidebar"]').click() + cy.get('.app-navigation-entry:contains("Upcoming cards") a').click() + + cy.get(`.card:contains("${newCardTitle}")`).should('be.visible') + cy.get('.dashboard-column:contains("Tomorrow")').should('be.visible') + cy.get('.dashboard-column:contains("Tomorrow") .card:contains("Hello world")').should('be.visible') + }) + }) })