swarm-ui: preview a draft flow's hit counts in the editor with the dry-run route
The editor's preview button posts the draft to POST /api/notify/dry-run and puts each box's hit count on the canvas; any edit hides the numbers. Boxes of kind request_reviewer label themselves "reviewer", so the long kind name no longer runs into the hit count shown beside it.
This commit is contained in:
parent
e8538d8690
commit
404d8334aa
7 changed files with 97 additions and 6 deletions
|
|
@ -21,6 +21,7 @@ import {
|
|||
replaceNode,
|
||||
savedAs,
|
||||
saveOutcome,
|
||||
previewRequest,
|
||||
saveRequest,
|
||||
seedFlow,
|
||||
siblingPosition,
|
||||
|
|
@ -246,6 +247,15 @@ test("saveRequest sends the whole document at the revision read", () => {
|
|||
assert.equal("builtins" in body, false, "built-ins are never sent");
|
||||
});
|
||||
|
||||
test("previewRequest posts the document without a revision", () => {
|
||||
const req = previewRequest([flow()], ["b1"]);
|
||||
assert.equal(req.method, "POST");
|
||||
const body = JSON.parse(req.body);
|
||||
assert.deepEqual(body.disabled_builtins, ["b1"]);
|
||||
assert.equal(body.flows[0].id, "f");
|
||||
assert.equal("revision" in body, false, "nothing is stored, so no revision");
|
||||
});
|
||||
|
||||
test("saveOutcome tells a stale revision from a refused document", () => {
|
||||
assert.equal(saveOutcome(200), "saved");
|
||||
assert.equal(saveOutcome(409), "conflict");
|
||||
|
|
|
|||
Loading…
Reference in a new issue