Adjust storeHelper test to use actual Tasks
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
parent
511502a6cd
commit
d6daa45e6c
1 changed files with 54 additions and 20 deletions
|
@ -1,24 +1,61 @@
|
||||||
import { sort } from '../../../../src/store/storeHelper'
|
import { sort } from '../../../../src/store/storeHelper'
|
||||||
|
import Task from '../../../../src/models/task'
|
||||||
|
|
||||||
const tasks = [
|
const vCalendars = [`
|
||||||
{
|
BEGIN:VCALENDAR\n
|
||||||
id: 1,
|
VERSION:2.0\n
|
||||||
due: '20191119T183901'
|
PRODID:-//Nextcloud Tasks 0.11.3\n
|
||||||
},
|
BEGIN:VTODO\n
|
||||||
{
|
CREATED:20170101T180000\n
|
||||||
id: 2,
|
DTSTAMP:20180101T180000\n
|
||||||
due: '20181119T183901'
|
LAST-MODIFIED:20180101T180000\n
|
||||||
},
|
UID:task01\n
|
||||||
{
|
SUMMARY:Test 1\n
|
||||||
id: 3,
|
DUE:20191119T183901\n
|
||||||
due: null
|
END:VTODO\n
|
||||||
},
|
END:VCALENDAR`,
|
||||||
{
|
`
|
||||||
id: 4,
|
BEGIN:VCALENDAR\n
|
||||||
due: '20151119T183901'
|
VERSION:2.0\n
|
||||||
},
|
PRODID:-//Nextcloud Tasks 0.11.3\n
|
||||||
|
BEGIN:VTODO\n
|
||||||
|
CREATED:20170101T180000\n
|
||||||
|
DTSTAMP:20180101T180000\n
|
||||||
|
LAST-MODIFIED:20180101T180000\n
|
||||||
|
UID:task02\n
|
||||||
|
SUMMARY:Test 1\n
|
||||||
|
DUE:20181119T183901\n
|
||||||
|
END:VTODO\n
|
||||||
|
END:VCALENDAR`,
|
||||||
|
`
|
||||||
|
BEGIN:VCALENDAR\n
|
||||||
|
VERSION:2.0\n
|
||||||
|
PRODID:-//Nextcloud Tasks 0.11.3\n
|
||||||
|
BEGIN:VTODO\n
|
||||||
|
CREATED:20170101T180000\n
|
||||||
|
DTSTAMP:20180101T180000\n
|
||||||
|
LAST-MODIFIED:20180101T180000\n
|
||||||
|
UID:task03\n
|
||||||
|
SUMMARY:Test 1\n
|
||||||
|
END:VTODO\n
|
||||||
|
END:VCALENDAR`,
|
||||||
|
`
|
||||||
|
BEGIN:VCALENDAR\n
|
||||||
|
VERSION:2.0\n
|
||||||
|
PRODID:-//Nextcloud Tasks 0.11.3\n
|
||||||
|
BEGIN:VTODO\n
|
||||||
|
CREATED:20170101T180000\n
|
||||||
|
DTSTAMP:20180101T180000\n
|
||||||
|
LAST-MODIFIED:20180101T180000\n
|
||||||
|
UID:task04\n
|
||||||
|
SUMMARY:Test 1\n
|
||||||
|
DUE:20151119T183901\n
|
||||||
|
END:VTODO\n
|
||||||
|
END:VCALENDAR`,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const tasks = vCalendars.map((vCalendar) => {new Task(vCalendar) })
|
||||||
|
|
||||||
describe('storeHelper', () => {
|
describe('storeHelper', () => {
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
@ -35,7 +72,4 @@ describe('storeHelper', () => {
|
||||||
const receivedTasks = sort(clonedTasks, 'due', 1)
|
const receivedTasks = sort(clonedTasks, 'due', 1)
|
||||||
expect(receivedTasks).toEqual(expectedTasks)
|
expect(receivedTasks).toEqual(expectedTasks)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("Tests if correct tasks are found for the 'current' collection.", () => {
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue