feat: restore legacy named playlist workflows
This commit is contained in:
@@ -132,6 +132,24 @@ test("dynamic NXT session changes exactly at local 13:00 without losing native p
|
||||
assert.equal(workflow.matchesRaw(atThirteen, sourceRaw), true);
|
||||
});
|
||||
|
||||
test("enabled replacement is immutable and retains NXT proof across session refresh", () => {
|
||||
const sourceRaw = raw({ enabled: true });
|
||||
const pending = workflow.classify(sourceRaw, { id: "db-toggle", fadeDuration: 6 });
|
||||
const outcome = workflow.normalizeResponse(response(resolved({ itemIndex: 4 })),
|
||||
"load-1", [pending]).rows[0];
|
||||
const entry = workflow.materialize(pending, outcome);
|
||||
const replacement = workflow.withEnabled(entry, false);
|
||||
const refreshed = workflow.refreshDynamicSession(replacement, new Date(2026, 6, 12, 13, 0));
|
||||
|
||||
assert.notEqual(replacement, entry);
|
||||
assert.equal(Object.isFrozen(replacement), true);
|
||||
assert.equal(entry.enabled, true);
|
||||
assert.equal(replacement.enabled, false);
|
||||
assert.equal(workflow.isMaterializedEntry(replacement), true);
|
||||
assert.equal(workflow.matchesRaw(refreshed, { ...sourceRaw, enabled: false }), true);
|
||||
assert.equal(workflow.withEnabled({ ...entry }, false), null);
|
||||
});
|
||||
|
||||
test("materialization refuses a failed outcome and non-pending objects", () => {
|
||||
const pending = workflow.classify(raw(), { id: "db-4", fadeDuration: 6 });
|
||||
assert.equal(workflow.materialize(pending, {
|
||||
|
||||
Reference in New Issue
Block a user