vikunja-frontend/cypress/e2e/list/prepareLists.ts

21 lines
521 B
TypeScript
Raw Permalink Normal View History

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'
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(() => {
const lists = createLists()
2021-11-17 18:11:19 +01:00
setLists(lists)
})
}