Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -247,10 +247,19 @@ describe('permission response IPC boundary', () => {

it('accepts only the supported stop source', () => {
assert.deepEqual(normalizeStopSessionInput(undefined), {});
assert.deepEqual(normalizeStopSessionInput({ source: 'stop_button', extra: true }), {
source: 'stop_button',
});
assert.deepEqual(
normalizeStopSessionInput({
source: 'stop_button',
expectedTurnId: 'turn-workhub',
extra: true,
}),
{ source: 'stop_button', expectedTurnId: 'turn-workhub' },
);
assert.throws(() => normalizeStopSessionInput(null), /stop session input/);
assert.throws(() => normalizeStopSessionInput({ source: 'toolbar' }), /stop session source/);
assert.throws(
() => normalizeStopSessionInput({ expectedTurnId: '' }),
/expectedTurnId/,
);
});
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -883,7 +883,15 @@ test("binds steer and stop to Host-owned queue and active Turn identities", asyn
kind: "queued",
},
);
await ipc.invoke("sessions:stop", "session-1");
await ipc.invoke("sessions:stop", "session-1", {
source: "stop_button",
expectedTurnId: "turn-unrelated",
});
assert.deepEqual(stopLifecycle, []);
await ipc.invoke("sessions:stop", "session-1", {
source: "stop_button",
expectedTurnId: "turn-1",
});
assert.deepEqual(stopLifecycle, ["teardown", "interrupt"]);

assert.deepEqual(submits, [
Expand Down
Loading