test: await client settlement in late-response cases (WealthLedger/frontend#61) (#81)
Frontend verify / commits (push) Skipped
Frontend verify / security (push) Successful in 10s
Frontend verify / verify (push) Successful in 7m35s

This commit was merged in pull request #81.
This commit is contained in:
2026-10-14 14:13:41 +03:00
parent edc7097bd7
commit f3725c202b
4 changed files with 39 additions and 14 deletions
+8 -2
View File
@@ -164,10 +164,16 @@ describe("persistent resource query lifecycle", () => {
});
await waitFor(() => expect(isStarted).toBe(true));
await act(() => result.current.observe());
// Capture the observation promise before releasing the old handler; the
// final assertion must follow its settlement, not the handler release.
let observation: Promise<unknown> = Promise.resolve();
await act(async () => {
observation = result.current.observe() ?? Promise.resolve();
await observation;
});
await act(async () => {
release();
await blocked;
await observation;
});
expect(result.current.data).toEqual(snapshot);
});