A To do card on server pages and in a device's drawer
- The open jobs about a server (or device) are listed on its page, with a line to add another already about it and a box to tick one off with Undo - GET /api/todos takes ?targetType=&targetId= to list only those about one thing - README and ROLES updated Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
18ceed62e8
commit
788b3e073c
10 files changed
+164
-9
No files matched your search
@@ -115,6 +115,13 @@ describe("the to-do list", () => {
|
||||
assert.equal(back.body.todo.doneAt, null);
|
||||
});
|
||||
|
||||
test("a server's page asks for just the jobs about it", async () => {
|
||||
const mine = (await send("GET", `/todos?targetType=server&targetId=${ids.web}`)).body.todos.map((t: any) => t.title);
|
||||
assert.deepEqual(mine, ["Replace the UPS battery"], "the two with nothing to do with it are left out");
|
||||
assert.equal((await send("GET", `/todos?targetType=server&targetId=999999`)).body.todos.length, 0);
|
||||
assert.equal((await send("GET", `/todos?targetType=bogus&targetId=${ids.web}`)).body.todos.length >= 3, true, "an unknown kind is no filter");
|
||||
});
|
||||
|
||||
test("a job can be changed, and removed; one that is not there is a 404", async () => {
|
||||
const changed = await send("PATCH", `/todos/${jobId}`, { title: "Replace the UPS battery (APC)", dueDate: null, assigneeId: null });
|
||||
assert.deepEqual([changed.body.todo.title, changed.body.todo.dueDate, changed.body.todo.assignee], ["Replace the UPS battery (APC)", null, null]);
|
||||
|
||||
Reference in new issue
Block a user