remove unecessary hasSteps
This commit is contained in:
@@ -21,22 +21,4 @@ describe('Task Record', () => {
|
|||||||
|
|
||||||
expect(TaskRecord.fromRecordable(recordable)).toEqual(recordable)
|
expect(TaskRecord.fromRecordable(recordable)).toEqual(recordable)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('tells if there are steps in the record', () => {
|
|
||||||
const record = fixtureRecordable({
|
|
||||||
stepRecords: {
|
|
||||||
[faker.datatype.uuid()]: fixtureTimeRange()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(TaskRecord.fromRecordable(record).hasStepRecords).toBe(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('tells if there are no steps in the record', () => {
|
|
||||||
const record = fixtureRecordable({
|
|
||||||
stepRecords: {}
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(TaskRecord.fromRecordable(record).hasStepRecords).toBe(false)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ export class TaskRecord implements Recordable {
|
|||||||
|
|
||||||
public constructor(public readonly taskId: string) {}
|
public constructor(public readonly taskId: string) {}
|
||||||
|
|
||||||
public get hasStepRecords() {
|
|
||||||
return Object.values(this.stepRecords).length > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
public static fromRecordable(recordable: Recordable) {
|
public static fromRecordable(recordable: Recordable) {
|
||||||
const taskRecord = new TaskRecord(recordable.taskId)
|
const taskRecord = new TaskRecord(recordable.taskId)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user