test(web): assert the deep-link 409 race actually reaches the connect phase
Copilot round 2: the "swallows the already-exists race and still connects" test only asserted that nothing was recorded, so a deep link that swallowed the 409 and then stopped forever would have stayed green. Rerender with the hydrated row and wait for the connect. Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
005e4c655a
commit
c37e795dca
1 changed files with 9 additions and 0 deletions
|
|
@ -917,6 +917,15 @@ describe("useConnectionLifecycle", () => {
|
||||||
|
|
||||||
await waitFor(() => expect(addServerImpl).toHaveBeenCalled());
|
await waitFor(() => expect(addServerImpl).toHaveBeenCalled());
|
||||||
expect(h.api().connectErrorMessage).toBeUndefined();
|
expect(h.api().connectErrorMessage).toBeUndefined();
|
||||||
|
|
||||||
|
// A 409 means the row is already on disk, so hydration surfaces it on a
|
||||||
|
// later render and the connect phase must still run. Asserting only that
|
||||||
|
// nothing was recorded would stay green for a deep link that swallows the
|
||||||
|
// error and then stops forever.
|
||||||
|
const fresh = entry(DEEP_LINK_SERVER_ID, { config: deepLinkConfig });
|
||||||
|
h.rerender({ servers: [fresh], deepLink: link, addServerImpl });
|
||||||
|
await waitFor(() => expect(connectSpy).toHaveBeenCalled());
|
||||||
|
expect(h.api().connectErrorMessage).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("records any other add failure on the machine-readable surface", async () => {
|
it("records any other add failure on the machine-readable surface", async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue