This commit is contained in:
@@ -7,7 +7,6 @@ type SearchTask = {
|
||||
description?: string
|
||||
parent_id?: string | null
|
||||
completed?: boolean
|
||||
tags?: { name: string }[]
|
||||
list_name?: string
|
||||
}
|
||||
|
||||
@@ -35,12 +34,11 @@ describe('task utilities', () => {
|
||||
expect(html).not.toContain('<script>')
|
||||
})
|
||||
|
||||
it('filters titles, descriptions, tags, and list names', () => {
|
||||
it('filters titles, descriptions, and list names', () => {
|
||||
const searchable: SearchTask[] = [
|
||||
...tasks,
|
||||
{ id: '4', title: 'Plan', tags: [{ name: '重要' }], list_name: '工作清单' },
|
||||
{ id: '4', title: 'Plan', list_name: '工作清单' },
|
||||
]
|
||||
expect(filterTasks(searchable, '重要').map((task) => task.id)).toEqual(['4'])
|
||||
expect(filterTasks(searchable, '工作').map((task) => task.id)).toEqual(['4'])
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user