mirror of
https://github.com/paperclipai/paperclip
synced 2026-04-25 17:25:15 +02:00
Fix rebased issue detail prefetch typing
This commit is contained in:
@@ -84,23 +84,14 @@ describe("issueDetailCache", () => {
|
||||
expect(queryClient.getQueryData(queryKeys.issues.detail(issue.id))).toEqual(issue);
|
||||
});
|
||||
|
||||
it("prefetches with the provided issue snapshot before the network result lands", async () => {
|
||||
it("prefetches with the provided issue snapshot without forcing a fresh fetch", async () => {
|
||||
const issue = createIssue();
|
||||
let releaseFetch: (() => void) | null = null;
|
||||
vi.mocked(issuesApi.get).mockImplementation(
|
||||
() =>
|
||||
new Promise<Issue>((resolve) => {
|
||||
releaseFetch = () => resolve(issue);
|
||||
}),
|
||||
);
|
||||
|
||||
const prefetchPromise = prefetchIssueDetail(queryClient, issue.identifier!, { issue });
|
||||
await prefetchIssueDetail(queryClient, issue.identifier!, { issue });
|
||||
|
||||
expect(getCachedIssueDetail(queryClient, issue.identifier)).toEqual(issue);
|
||||
expect(getCachedIssueDetail(queryClient, issue.id)).toEqual(issue);
|
||||
|
||||
releaseFetch?.();
|
||||
await prefetchPromise;
|
||||
expect(issuesApi.get).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("hydrates both cache aliases from a fetched issue detail response", async () => {
|
||||
|
||||
@@ -1651,7 +1651,6 @@ export function IssueDetail() {
|
||||
<Link
|
||||
to={createIssueDetailPath(ancestor.identifier ?? ancestor.id)}
|
||||
state={resolvedIssueDetailState ?? location.state}
|
||||
issuePrefetch={ancestor}
|
||||
onClickCapture={() =>
|
||||
rememberIssueDetailLocationState(
|
||||
ancestor.identifier ?? ancestor.id,
|
||||
|
||||
Reference in New Issue
Block a user