Skip to content

Assert the edge query stays pending when no schema exists - #2666

Merged
kmcginnes merged 1 commit into
mainfrom
strengthen-no-schema-edge-test
Nov 25, 2026
Merged

kmcginnes merged 1 commit into
mainfrom
strengthen-no-schema-edge-test

Conversation

@kmcginnes

Copy link
Copy Markdown
Collaborator

Summary

The test "should not fetch edge connections when no active schema exists" couldn't always tell "the edge query never ran" from "the query ran and found no edge types to fetch", so removing the query's enabled gate could slip past it.

User-facing: none

 expect(result.current.edgeDiscoveryQuery.fetchStatus).toBe("idle");
+expect(result.current.edgeDiscoveryQuery.status).toBe("pending");
 expect(fetchEdgeConnectionsSpy).not.toHaveBeenCalled();

Evidence

Before: with the gate in edgeConnectionsQuery replaced by enabled: true and the query allowed to settle, the test passed: fetchStatus returns to "idle" and the query function takes its empty-edge-list branch without calling fetchEdgeConnections.

After: agent-tested by mutating the gate locally and reverting:

gate in place                         -> pass
enabled: true, query still in flight  -> fail: fetchStatus expected "idle", received "fetching"
enabled: true, query settled          -> fail: status expected "pending", received "success"
enabled: true, settled, old test      -> pass (the gap this closes)

With the test's current timing, the existing fetchStatus check already catches the mutation, because the query is still fetching when it runs. The new status check covers the settled case, so the test no longer depends on the query being in flight at the assertion. Both checks stay.

Merge Danger

Door: two-way

Impact: none. Test-only.

Changelog entry

None needed. Test-only change.

Related


🤖 Written by an AI agent on my behalf.

@kmcginnes kmcginnes left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@kmcginnes
kmcginnes merged commit 3bc46e2 into main Nov 25, 2026
4 checks passed
@kmcginnes
kmcginnes deleted the strengthen-no-schema-edge-test branch November 25, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the no-active-schema edge test fail when the enabled gate is removed

1 participant