-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathactions.moveCommand.test.ts
45 lines (42 loc) · 1016 Bytes
/
actions.moveCommand.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import * as test from 'tape';
import { TaskItem, TaskStatus } from '../../src/helpers/utils';
import { moveCommand } from '../../src/helpers/commands/actions';
const state = {
tasks: [
{
id: 1,
tag: '@pomoday',
title: 'test task',
status: TaskStatus.WAIT,
logs: [],
archived: false,
} as TaskItem,
{
id: 2,
tag: '@work',
title: 'test work task',
status: TaskStatus.DONE,
logs: [],
archived: false,
} as TaskItem,
{
id: 3,
tag: '@work',
title: 'test second work task',
status: TaskStatus.WIP,
logs: [],
archived: false,
} as TaskItem,
],
};
test('move single task', t => {
const output = moveCommand([], state, [1], { tag: '@work' });
t.equal(output[0].tag, '@work');
t.end();
});
test('move many task', t => {
const output = moveCommand([], state, [2, 3], { tag: '@pomoday' });
t.equal(output[1].tag, '@pomoday');
t.equal(output[2].tag, '@pomoday');
t.end();
});