-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask.test.js
More file actions
45 lines (40 loc) · 1.09 KB
/
task.test.js
File metadata and controls
45 lines (40 loc) · 1.09 KB
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 path from "path";
import Task from "./task.js";
import fs from "fs";
import { TaskManager } from "./task-manager.js";
const html = fs.readFileSync(path.resolve(__dirname, "./index.html"), "utf8");
describe("Test Task Planner Actions", function () {
beforeAll(function () {
document.body.innerHTML = html.toString();
const taskMgr = new TaskManager();
});
test("It should Create New Task Object", function () {
const task = new Task(
"task1",
"grocery shopping",
"visit coles",
"shakeel",
"pending",
"08/08/20",
"12:30 Pm"
);
expect(task.id).toBe("task1");
expect(task.assignee).toBe("shakeel");
expect(task.date).toBe("08/08/20");
expect(task.description).toBe("visit coles");
expect(task.name).toBe("grocery shopping");
expect(task.status).toBe("pending");
expect(task.time).toBe("12:30 Pm");
});
test("html to string () ", () => {
const task = new Task(
"task1",
"grocery shopping",
"visit coles",
"shakeel",
"pending",
"08/08/20",
"12:30 Pm"
);
});
});