make compatible for new Taskable

This commit is contained in:
Julien Calixte
2023-04-09 10:47:58 +02:00
parent d1429ca08f
commit 448adebaae
2 changed files with 2 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ describe('Task', () => {
it('allows a new task from a taskable object', () => { it('allows a new task from a taskable object', () => {
const taskable: Taskable = { const taskable: Taskable = {
id: faker.datatype.uuid(), id: faker.datatype.uuid(),
date: faker.date.recent(),
title: faker.animal.lion(), title: faker.animal.lion(),
link: faker.internet.url(), link: faker.internet.url(),
steps: [createStepFixture()] steps: [createStepFixture()]

View File

@@ -34,6 +34,7 @@ export class Task implements Taskable {
public static fromTaskable(taskable: Taskable) { public static fromTaskable(taskable: Taskable) {
const task = new Task(taskable.id, taskable.title) const task = new Task(taskable.id, taskable.title)
task.link = taskable.link task.link = taskable.link
task.date = taskable.date
task.addSteps(...taskable.steps) task.addSteps(...taskable.steps)
return task return task