Skip to content

Commit e5ef80a

Browse files
test(mobile): wait for native device input admission
1 parent 50978e1 commit e5ef80a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎apps/mobile/src/features/devices/device-stream.browser.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ async function setup() {
3838
static OPEN = 1;
3939
readyState = 1;
4040
onopen: (() => void) | null = null;
41+
onmessage: ((event: { data: ArrayBuffer }) => void) | null = null;
4142
close = vi.fn();
4243
send = vi.fn();
4344
constructor() {
@@ -86,6 +87,8 @@ it("bridges shared first-frame readiness, image failure, and a successful fresh
8687
const { elements, messages, sockets, configuration } = await setup();
8788
sockets[0]!.onopen?.();
8889
expect(messages()).not.toContainEqual({ type: "status", status: "streaming" });
90+
expect(messages()).not.toContainEqual({ type: "input", connected: true });
91+
sockets[0]!.onmessage?.({ data: new Uint8Array([0x83]).buffer });
8992
expect(messages()).toContainEqual({ type: "input", connected: true });
9093
const image = elements.find((element) => element.tag === "img")!;
9194
image.naturalWidth = 400;

0 commit comments

Comments
 (0)