Skip to content

Commit e7c7c28

Browse files
committed
test(daemon): assert direct-route runner calls keep the request id through the provider scope
Re-review follow-up on #1389: the keyboard-dismiss provider-scope test now sends a requestId and asserts the recorded runner call carries it, proving the request-boundary appleRunnerProvider scope preserves per-request context for direct daemon routes (not just deviceId matching).
1 parent 685bd4d commit e7c7c28

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎test/integration/provider-scenarios/provider-ios-runner-transport.test.ts‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,28 @@ test('provider-supplied Apple runner transport reuses the shared interactor stac
103103
// Daemon routes that issue runner commands OUTSIDE interactor methods (keyboard,
104104
// native alert, point read, iOS sequences) must reach the provider transport via
105105
// the request-boundary `appleRunnerProvider` scope instead of escaping to the
106-
// local XCTest runtime.
106+
// local XCTest runtime — and that scope must preserve the request's id, since
107+
// scoped-provider resolution requires the scope and call requestIds to match.
107108
test('daemon direct runner routes reach the provider transport through the request scope', async () => {
108109
await withProviderScenarioResource(createRunnerTransportWorld, async ({ daemon, calls }) => {
109110
const lease = await allocateLease(daemon);
110-
const request = { flags: leaseFlags(lease.leaseId), meta: leaseMeta(lease.leaseId) };
111-
assertRpcOk(await daemon.callCommand('open', ['com.example.app'], request.flags, request));
111+
const flags = leaseFlags(lease.leaseId);
112+
assertRpcOk(
113+
await daemon.callCommand('open', ['com.example.app'], flags, {
114+
meta: leaseMeta(lease.leaseId),
115+
}),
116+
);
112117

113118
calls.runner.length = 0;
114-
assertRpcOk(await daemon.callCommand('keyboard', ['dismiss'], request.flags, request));
119+
const keyboardMeta = { ...leaseMeta(lease.leaseId), requestId: 'req-keyboard-1' };
120+
assertRpcOk(await daemon.callCommand('keyboard', ['dismiss'], flags, { meta: keyboardMeta }));
115121
const dismiss = calls.runner.find((call) => call.command.command === 'keyboardDismiss');
116122
assert.ok(dismiss, 'expected keyboardDismiss on the provider transport, not local XCTest');
123+
assert.equal(
124+
dismiss.options.requestId,
125+
'req-keyboard-1',
126+
'direct-route runner call lost the per-request id across the request-boundary scope',
127+
);
117128
});
118129
});
119130

0 commit comments

Comments
 (0)