Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): the desktop browser host answers every request that arrives together, not only the last #15965

Closedsantiago-ramos-02(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/15965/headopened View on GitHub

Showing 4 changed files with 19 additions and 17 deletions (loading 3).

x
0 of 4 viewed, 4 left
19 additions and 17 deletionsapps/web/src/components/preview/PreviewAutomationHosts.test.tsxModified
View file
@@ -90,9 +90,9 @@
};
const emptyList = { sessions: [], serverEpoch: "test-server", revision: 0 };
const listAtom = Atom.make(AsyncResult.success(emptyList));
-const requestsAtom = Atom.make<AsyncResult.AsyncResult<PreviewAutomationStreamEvent, Error>>(
- AsyncResult.initial(false),
-);
+const requestsAtom = Atom.make<
+ AsyncResult.AsyncResult<ReadonlyArray<PreviewAutomationStreamEvent>, Error>
+>(AsyncResult.initial(false));
const requestEvent: PreviewAutomationStreamEvent = {
type: "request",
connectionId: "automation-connection",
@@ -164,7 +164,7 @@
mocks.respond.mockImplementationOnce(async ({ input }) => response.resolve(input));
​
await act(async () => {
- appAtomRegistry.set(requestsAtom, AsyncResult.success(requestEvent));
+ appAtomRegistry.set(requestsAtom, AsyncResult.success([requestEvent]));
await readStarted.promise;
});
expect(mocks.open).not.toHaveBeenCalled();
@@ -195,7 +195,7 @@
mocks.respond.mockImplementationOnce(async ({ input }) => response.resolve(input));
​
await act(async () => {
- appAtomRegistry.set(requestsAtom, AsyncResult.success(requestEvent));
+ appAtomRegistry.set(requestsAtom, AsyncResult.success([requestEvent]));