Compare commits
3 Commits
4b202b6f3a
...
e2c71bf636
Author | SHA1 | Date |
---|---|---|
renovate | e2c71bf636 | |
kolaente | d7fb1a1e14 | |
kolaente | 7e218e03b2 |
|
@ -128,4 +128,24 @@ describe('Home Page Task Overview', () => {
|
||||||
.last()
|
.last()
|
||||||
.should('contain.text', newTaskTitle)
|
.should('contain.text', newTaskTitle)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('Should show the cta buttons for new list when there are no tasks', () => {
|
||||||
|
TaskFactory.truncate()
|
||||||
|
|
||||||
|
cy.visit('/')
|
||||||
|
|
||||||
|
cy.get('.home.app-content .content')
|
||||||
|
.should('contain.text', 'You can create a new list for your new tasks:')
|
||||||
|
.should('contain.text', 'Or import your lists and tasks from other services into Vikunja:')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Should not show the cta buttons for new list when there are tasks', () => {
|
||||||
|
seedTasks()
|
||||||
|
|
||||||
|
cy.visit('/')
|
||||||
|
|
||||||
|
cy.get('.home.app-content .content')
|
||||||
|
.should('not.contain.text', 'You can create a new list for your new tasks:')
|
||||||
|
.should('not.contain.text', 'Or import your lists and tasks from other services into Vikunja:')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -546,5 +546,35 @@ describe('Task', () => {
|
||||||
cy.get('.bucket .task .footer .icon svg.fa-paperclip')
|
cy.get('.bucket .task .footer .icon svg.fa-paperclip')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('Can check items off a checklist', () => {
|
||||||
|
const tasks = TaskFactory.create(1, {
|
||||||
|
id: 1,
|
||||||
|
description: `
|
||||||
|
This is a checklist:
|
||||||
|
|
||||||
|
* [ ] one item
|
||||||
|
* [ ] another item
|
||||||
|
* [ ] third item
|
||||||
|
* [ ] fourth item
|
||||||
|
* [x] and this one is already done
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
cy.visit(`/tasks/${tasks[0].id}`)
|
||||||
|
|
||||||
|
cy.get('.task-view .checklist-summary')
|
||||||
|
.should('contain.text', '1 of 5 tasks')
|
||||||
|
cy.get('.editor .content ul > li input[type=checkbox]')
|
||||||
|
.eq(2)
|
||||||
|
.click()
|
||||||
|
|
||||||
|
cy.get('.editor .content ul > li input[type=checkbox]')
|
||||||
|
.eq(2)
|
||||||
|
.should('be.checked')
|
||||||
|
cy.get('.editor .content input[type=checkbox]')
|
||||||
|
.should('have.length', 5)
|
||||||
|
cy.get('.task-view .checklist-summary')
|
||||||
|
.should('contain.text', '2 of 5 tasks')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -285,9 +285,9 @@ function handleCheckboxClick(e: Event) {
|
||||||
console.debug('no index found')
|
console.debug('no index found')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.debug(index, text.value.slice(index, 9))
|
const listPrefix = text.value.substring(index, index + 1)
|
||||||
|
|
||||||
const listPrefix = text.value.slice(index, 1)
|
console.debug({index, listPrefix, checked, text: text.value})
|
||||||
|
|
||||||
text.value = replaceAt(text.value, index, `${listPrefix} ${checked ? '[x]' : '[ ]'} `)
|
text.value = replaceAt(text.value, index, `${listPrefix} ${checked ? '[x]' : '[ ]'} `)
|
||||||
bubble()
|
bubble()
|
||||||
|
|
|
@ -28,6 +28,7 @@ import {useLabelStore} from '@/stores/labels'
|
||||||
import {useListStore} from '@/stores/lists'
|
import {useListStore} from '@/stores/lists'
|
||||||
import {useAttachmentStore} from '@/stores/attachments'
|
import {useAttachmentStore} from '@/stores/attachments'
|
||||||
import {useKanbanStore} from '@/stores/kanban'
|
import {useKanbanStore} from '@/stores/kanban'
|
||||||
|
import {useBaseStore} from '@/stores/base'
|
||||||
|
|
||||||
// IDEA: maybe use a small fuzzy search here to prevent errors
|
// IDEA: maybe use a small fuzzy search here to prevent errors
|
||||||
function findPropertyByValue(object, key, value) {
|
function findPropertyByValue(object, key, value) {
|
||||||
|
@ -105,6 +106,7 @@ export const useTaskStore = defineStore('task', {
|
||||||
const cancel = setModuleLoading(this)
|
const cancel = setModuleLoading(this)
|
||||||
try {
|
try {
|
||||||
this.tasks = await taskService.getAll({}, params)
|
this.tasks = await taskService.getAll({}, params)
|
||||||
|
useBaseStore().setHasTasks(this.tasks.length > 0)
|
||||||
return this.tasks
|
return this.tasks
|
||||||
} finally {
|
} finally {
|
||||||
cancel()
|
cancel()
|
||||||
|
|
Reference in New Issue