2021-11-17 18:11:19 +01:00
|
|
|
import {ListFactory} from '../../factories/list'
|
|
|
|
import {UserFactory} from '../../factories/user'
|
|
|
|
import {NamespaceFactory} from '../../factories/namespace'
|
|
|
|
import {TaskFactory} from '../../factories/task'
|
|
|
|
|
2022-08-09 11:55:19 +02:00
|
|
|
export function createLists() {
|
|
|
|
UserFactory.create(1)
|
|
|
|
NamespaceFactory.create(1)
|
|
|
|
const lists = ListFactory.create(1, {
|
|
|
|
title: 'First List'
|
|
|
|
})
|
|
|
|
TaskFactory.truncate()
|
|
|
|
return lists
|
|
|
|
}
|
|
|
|
|
2021-11-17 18:11:19 +01:00
|
|
|
export function prepareLists(setLists = () => {}) {
|
|
|
|
beforeEach(() => {
|
2022-08-09 11:55:19 +02:00
|
|
|
const lists = createLists()
|
2021-11-17 18:11:19 +01:00
|
|
|
setLists(lists)
|
|
|
|
})
|
|
|
|
}
|