Skip to content

Commit edf3815

Browse files
committed
test(gateway): fold bind/inspect parity into the existing fixture
The parity test duplicated the whole gateway construction (single apple module, inline webdriver ProviderDeviceRuntime literal) from the test directly above it instead of reusing it. Appended the inspectFacts() call and the equality assertion to that test instead, and switched toEqual to toStrictEqual: toEqual ignores undefined-valued keys, and an omitted cell is exactly how the two facts maps could drift from each other.
1 parent 983ade3 commit edf3815

1 file changed

Lines changed: 1 addition & 28 deletions

File tree

‎src/platform-runtime-gateway.test.ts‎

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -514,37 +514,10 @@ describe('composed platform runtime gateway', () => {
514514
});
515515
expect(hostLoad).not.toHaveBeenCalled();
516516
expect(localLoad).not.toHaveBeenCalled();
517-
});
518-
519-
test('reports identical facts for a provider without a module on both the bind and inspect paths', async () => {
520-
const runtimeGateway = createComposedPlatformRuntimeGateway({
521-
modules: new Map([
522-
[
523-
'apple',
524-
{
525-
family: 'apple',
526-
loadRuntime: async () =>
527-
runtimeOwner({ ref: { kind: 'local-family', family: 'apple' } }),
528-
},
529-
],
530-
]),
531-
loadHost: async () => ({}) as PlatformRuntimeHost,
532-
providerRuntimes: [
533-
{
534-
provider: 'webdriver',
535-
leaseLifecycle: {},
536-
deviceInventoryProvider: async () => null,
537-
ownsDevice: () => true,
538-
getInteractor: () => undefined,
539-
shutdown: async () => {},
540-
},
541-
],
542-
});
543-
const binding = await runtimeGateway.bind({ device, intent: { kind: 'ordinary' }, scope });
544517
const inspected = await runtimeGateway.inspectFacts(device);
545518
// The bind and inspect arms build this fact set independently; both must derive from the same
546519
// construction path rather than two hand-maintained maps that can drift from each other.
547-
expect(binding.facts).toEqual(inspected);
520+
expect(binding.facts).toStrictEqual(inspected);
548521
});
549522

550523
test.each(LIFECYCLE_FACETS)(

0 commit comments

Comments
 (0)