fix(task): setting progress was not properly saved
This commit is contained in:
parent
fd71de4b5d
commit
1be516a905
2 changed files with 37 additions and 1 deletions
|
@ -440,5 +440,30 @@ describe('Task', () => {
|
||||||
.get('.select select')
|
.get('.select select')
|
||||||
.should('have.value', '4')
|
.should('have.value', '4')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it.only('Can set the progress for a task', () => {
|
||||||
|
const tasks = TaskFactory.create(1, {
|
||||||
|
id: 1,
|
||||||
|
})
|
||||||
|
cy.visit(`/tasks/${tasks[0].id}`)
|
||||||
|
|
||||||
|
cy.get('.task-view .action-buttons .button')
|
||||||
|
.contains('Set Progress')
|
||||||
|
.click()
|
||||||
|
cy.get('.task-view .columns.details .column')
|
||||||
|
.contains('Progress')
|
||||||
|
.get('.select select')
|
||||||
|
.select('50%')
|
||||||
|
cy.get('.global-notification')
|
||||||
|
.should('contain', 'Success')
|
||||||
|
|
||||||
|
cy.wait(200)
|
||||||
|
|
||||||
|
cy.get('.task-view .columns.details .column')
|
||||||
|
.contains('Progress')
|
||||||
|
.get('.select select')
|
||||||
|
.should('be.visible')
|
||||||
|
.should('have.value', '0.5')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
</div>
|
</div>
|
||||||
<percent-done-select
|
<percent-done-select
|
||||||
:disabled="!canWrite"
|
:disabled="!canWrite"
|
||||||
@update:model-value="saveTask"
|
@update:model-value="setPercentDone"
|
||||||
ref="percentDone"
|
ref="percentDone"
|
||||||
v-model="task.percentDone"/>
|
v-model="task.percentDone"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -765,6 +765,17 @@ async function setPriority(priority: Priority) {
|
||||||
task: newTask,
|
task: newTask,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function setPercentDone(percentDone: number) {
|
||||||
|
const newTask: ITask = {
|
||||||
|
...task,
|
||||||
|
percentDone,
|
||||||
|
}
|
||||||
|
|
||||||
|
return saveTask({
|
||||||
|
task: newTask,
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in a new issue