generated from coulomb/repo-seed
feat(tasks): adopt canonical task statuses
This commit is contained in:
@@ -72,7 +72,7 @@ function okResponse(overrides = {}) {
|
||||
target_id: "00000000-0000-0000-0000-000000000001",
|
||||
actor: "dashboard",
|
||||
current_status: "todo",
|
||||
target_status: "in_progress",
|
||||
target_status: "progress",
|
||||
file_backed: true,
|
||||
archived_file: false,
|
||||
task_linked: true,
|
||||
@@ -102,23 +102,23 @@ test("status control posts dashboard changes through reconciliation", async () =
|
||||
const root = statusControl({
|
||||
entity,
|
||||
type: "task",
|
||||
statuses: ["todo", "in_progress"],
|
||||
statuses: ["todo", "progress"],
|
||||
onSaved: (updated, result) => {
|
||||
saved = {updated, result};
|
||||
},
|
||||
});
|
||||
const [select, message] = root.children;
|
||||
|
||||
select.value = "in_progress";
|
||||
select.value = "progress";
|
||||
await select.listeners.change();
|
||||
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(requests[0].url, "http://127.0.0.1:8000/reconciliation/state-change");
|
||||
assert.equal(requests[0].body.target_type, "task");
|
||||
assert.equal(requests[0].body.target_status, "in_progress");
|
||||
assert.equal(requests[0].body.target_status, "progress");
|
||||
assert.equal(requests[0].body.expected_current_status, "todo");
|
||||
assert.equal(requests[0].body.apply, true);
|
||||
assert.equal(entity.status, "in_progress");
|
||||
assert.equal(entity.status, "progress");
|
||||
assert.equal(message.textContent, "synced");
|
||||
assert.equal(saved.result.write_through_result, "applied");
|
||||
});
|
||||
@@ -131,7 +131,7 @@ test("status control keeps local state on reconciliation conflicts", async () =>
|
||||
ok: true,
|
||||
json: async () => okResponse({
|
||||
current_status: "done",
|
||||
target_status: "in_progress",
|
||||
target_status: "progress",
|
||||
reconciliation_class: "deferred",
|
||||
reason: "cached task status changed from expected 'todo' to 'done'",
|
||||
follow_up: "refresh the dashboard and retry the state change if it is still intended",
|
||||
@@ -147,14 +147,14 @@ test("status control keeps local state on reconciliation conflicts", async () =>
|
||||
const root = statusControl({
|
||||
entity,
|
||||
type: "task",
|
||||
statuses: ["todo", "in_progress"],
|
||||
statuses: ["todo", "progress"],
|
||||
onSaved: () => {
|
||||
saved = true;
|
||||
},
|
||||
});
|
||||
const [select, message] = root.children;
|
||||
|
||||
select.value = "in_progress";
|
||||
select.value = "progress";
|
||||
await select.listeners.change();
|
||||
|
||||
assert.equal(requests.length, 1);
|
||||
|
||||
Reference in New Issue
Block a user