feat(gateway): wire safe-point runtime cancellation for agent.cancel
This commit is contained in:
@@ -113,6 +113,24 @@ describe('SessionBridge', () => {
|
||||
expect(bridge.isBusy('conn-1')).toBe(false);
|
||||
});
|
||||
|
||||
it('cancel returns false when no active operation exists', () => {
|
||||
const bridge = createBridge();
|
||||
bridge.connect('conn-1');
|
||||
|
||||
expect(bridge.cancel('conn-1')).toBe(false);
|
||||
});
|
||||
|
||||
it('cancel requests cancellation when connection is busy', () => {
|
||||
const bridge = createBridge();
|
||||
bridge.connect('conn-1');
|
||||
const agent = bridge.getAgent('conn-1');
|
||||
const cancelSpy = vi.spyOn(agent!, 'cancel');
|
||||
|
||||
bridge.setBusy('conn-1', true);
|
||||
expect(bridge.cancel('conn-1')).toBe(true);
|
||||
expect(cancelSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('switchSession changes session for a connection', () => {
|
||||
const bridge = createBridge();
|
||||
bridge.connect('conn-1');
|
||||
|
||||
Reference in New Issue
Block a user