Merge pull request #5290 from nextcloud/bugfix/collection-2
This commit is contained in:
@@ -217,6 +217,39 @@ describe('Card', function() {
|
||||
cy.get(`.card:contains("${newCardTitle}")`).find('[data-due-state]').should('not.exist')
|
||||
})
|
||||
|
||||
it('Add a label', function() {
|
||||
const newCardTitle = 'Card with labels'
|
||||
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
.first().click()
|
||||
cy.get('.stack__card-add form input#new-stack-input-main')
|
||||
.type(newCardTitle)
|
||||
cy.get('.stack__card-add form input[type=submit]')
|
||||
.first().click()
|
||||
cy.get(`.card:contains("${newCardTitle}")`).should('be.visible').click()
|
||||
|
||||
cy.get('#app-sidebar-vue [data-test="tag-selector"]').should('be.visible').click()
|
||||
cy.get('.multiselect__option:contains("Action needed")').should('be.visible').click()
|
||||
|
||||
cy.get('[data-test="tag-selector"] .selector-wrapper--icon').click()
|
||||
cy.get('.multiselect__option:contains("Action needed")').should('not.be.visible')
|
||||
|
||||
cy.get('[data-test="tag-selector"] .multiselect__tags .tag:contains("Action needed")')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get(`.card:contains("${newCardTitle}")`).find('.labels li:contains("Action needed")')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('#app-sidebar-vue [data-test="tag-selector"]').should('be.visible').click()
|
||||
cy.get('.multiselect__option:contains("Later")').should('be.visible').click()
|
||||
cy.get('.multiselect__option:contains("Action needed")').should('be.visible').click()
|
||||
|
||||
cy.get(`.card:contains("${newCardTitle}")`).find('.labels li:contains("Later")')
|
||||
.should('be.visible')
|
||||
cy.get(`.card:contains("${newCardTitle}")`).find('.labels li:contains("Action needed")')
|
||||
.should('not.exist')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@@ -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')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="selector-wrapper" :aria-label="t('deck', 'Assign to users/groups/circles')">
|
||||
<div class="selector-wrapper" :aria-label="t('deck', 'Assign to users/groups/circles')" data-test="assignment-selector">
|
||||
<div class="selector-wrapper--icon">
|
||||
<AccountMultiple :size="20" />
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div data-test="description">
|
||||
<h5>
|
||||
{{ t('deck', 'Description') }}
|
||||
<span v-if="descriptionLastEdit && !descriptionSaving">{{ t('deck', '(Unsaved)') }}</span>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<CardDetailEntry :label="t('deck', 'Assign a due date to this card…')">
|
||||
<CardDetailEntry :label="t('deck', 'Assign a due date to this card…')" data-test="due-date-selector">
|
||||
<Calendar v-if="!card.done" slot="icon" :size="20" />
|
||||
<CalendarCheck v-else slot="icon" :size="20" />
|
||||
<template v-if="!card.done && !card.archived">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="selector-wrapper" :aria-label="t('deck', 'Assign a tag to this card…')">
|
||||
<div class="selector-wrapper" :aria-label="t('deck', 'Assign a tag to this card…')" data-test="tag-selector">
|
||||
<div class="selector-wrapper--icon">
|
||||
<TagMultiple :size="20" />
|
||||
</div>
|
||||
<NcMultiselect v-model="assignedLabels"
|
||||
<NcMultiselect :value="assignedLabels"
|
||||
class="selector-wrapper--selector"
|
||||
:multiple="true"
|
||||
:disabled="disabled"
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
return [...this.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
|
||||
},
|
||||
assignedLabels() {
|
||||
return [...this.card.labels].local((a, b) => (a.title < b.title) ? -1 : 1)
|
||||
return [...this.card.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -52,11 +52,11 @@ export default {
|
||||
const promise = (async () => {
|
||||
commit('setCurrentBoard', null)
|
||||
const assignedCards = await apiClient.get('upcoming')
|
||||
const assignedCardsFlat = assignedCards.flat()
|
||||
const assignedCardsFlat = Object.values(assignedCards).flat()
|
||||
for (const i in assignedCardsFlat) {
|
||||
commit('addCard', assignedCardsFlat[i])
|
||||
}
|
||||
commit('setAssignedCards', assignedCardsFlat)
|
||||
commit('setAssignedCards', assignedCards)
|
||||
commit('setLoading', false)
|
||||
})()
|
||||
commit('setLoading', promise)
|
||||
|
||||
Reference in New Issue
Block a user