Skip to content

Commit

Permalink
refactor: handle task mock type
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jun 14, 2023
1 parent 64a7614 commit 44c3f58
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions apps/frontend/src/store/__mocks__/tasks.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { vi } from 'vitest'
import type { Task } from '../tasks'
import { TaskStatus } from '../tasks'
export { TaskStatus } from '../tasks'

// 这里还是缺了一个类型
// TODO 这里要等后端处理好返回的类型之后在解决
const tasks = [
const tasks: Task[] = [
{
_id: '0',
id: '0',
title: '吃饭',
content: '今天吃什么',
status: 'active',
status: TaskStatus.ACTIVE,
projectId: '1',
position: 0,
},
{
_id: '1',
id: '1',
title: '写代码',
content: '一杯茶,一包烟,一行代码写一天',
status: 'active',
status: TaskStatus.ACTIVE,
projectId: '1',
position: 1,
},
{
_id: '2',
id: '2',
title: '睡觉',
content: '一睡睡一天',
status: 'completed',
status: TaskStatus.COMPLETED,
projectId: '1',
position: 2,
},
Expand All @@ -33,7 +33,7 @@ const tasks = [
export const useTasksStore = vi.fn(() => {
return {
findAllTasksNotRemoved() {
return tasks
return Promise.resolve(tasks)
},
}
})

1 comment on commit 44c3f58

@vercel
Copy link

@vercel vercel bot commented on 44c3f58 Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.