fix: persist and retry run alerts and honor notification modes
This commit is contained in:
@@ -31,6 +31,26 @@ const frame = (runId, status, extra = {}) => ({
|
||||
...extra,
|
||||
});
|
||||
|
||||
test("off suppresses every browser alert from summaries and pushed modes", () => {
|
||||
for (const status of ["waiting", "failed", "succeeded"]) {
|
||||
const ledger = createAlertLedger();
|
||||
ledger.seed([{ id: 1, status: "running", notify_mode: "off" }]);
|
||||
assert.equal(ledger.observe(frame(1, status)), null);
|
||||
ledger.seed([{ id: 1, status: "running", notify_mode: "on" }]);
|
||||
assert.equal(ledger.observe(frame(1, status, { notify_mode: "off" })), null);
|
||||
}
|
||||
});
|
||||
|
||||
test("on adds final success once while auto retains attention-only semantics", () => {
|
||||
const ledger = createAlertLedger();
|
||||
ledger.seed([{ id: 1, status: "running", notify_mode: "on" }, { id: 2, status: "running", notify_mode: "auto" }]);
|
||||
const alert = ledger.observe(frame(1, "succeeded"));
|
||||
assert.equal(alert.title, "A run succeeded");
|
||||
assert.equal(alert.key, "1:Succeeded");
|
||||
assert.equal(ledger.observe(frame(1, "succeeded")), null);
|
||||
assert.equal(ledger.observe(frame(2, "succeeded")), null);
|
||||
});
|
||||
|
||||
test("headlines are exactly the app's two, and unknown kinds are blank", () => {
|
||||
assert.equal(alertTitle(AttentionKind.Failed), "A run failed");
|
||||
assert.equal(alertTitle(AttentionKind.Decision), "A run needs your decision");
|
||||
|
||||
Reference in New Issue
Block a user