Skip to content

Commit f8c6039

Browse files
test(composer): keep only cross-host suggestion tests that fail on main
Drop the mocked browser test of the exact-number lookup (it passes on main and covers hook logic), revert an edit that only exercised the test's own key function, and note why only the host is taken from an exact result's URL. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 8df08aa commit f8c6039

4 files changed

Lines changed: 13 additions & 103 deletions

File tree

‎apps/mobile/src/state/queries.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export function useComposerPullRequestSearch(input: {
152152
})
153153
: null,
154154
);
155+
// Only the host: the URL's full repository path would not match the project's selector.
155156
const exactEntry = exact.data
156157
? { ...exact.data, host: legacyThreadPullRequestKey(exact.data).host }
157158
: null;

‎apps/web/src/components/chat/useComposerMenuItems.browser.test.tsx‎

Lines changed: 0 additions & 82 deletions
This file was deleted.

‎apps/web/src/components/chat/useComposerMenuItems.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ export function useComposerMenuItems({
334334
? [
335335
{
336336
...exactPullRequestLookup.data,
337+
// Only the host: the URL's full repository path would not match the project's selector.
337338
host: legacyThreadPullRequestKey(exactPullRequestLookup.data).host,
338339
},
339340
]

‎packages/shared/src/composerPullRequestMatches.test.ts‎

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -92,33 +92,23 @@ describe("linked pull requests", () => {
9292
host: "gitlab.com",
9393
url: "https://gitlab.com/wireshark/wireshark/-/merge_requests/1",
9494
});
95-
for (const links of [
96-
[github, gitlab],
97-
[gitlab, github],
98-
]) {
99-
const linked = composerPullRequestsFromLinks(links, "p1");
100-
const result = filterComposerPullRequestMatches({
101-
keyOf,
102-
entries: [],
103-
linked,
104-
projectId: "p1",
105-
repository: "wireshark/wireshark",
106-
query: "1",
107-
limit: 10,
108-
});
109-
expect(result.map((match) => match.url)).toEqual(links.map((link) => link.url));
110-
expect(linked.map((match) => match.host)).toEqual(links.map((link) => link.host));
111-
}
95+
const result = filterComposerPullRequestMatches({
96+
keyOf,
97+
entries: [],
98+
linked: composerPullRequestsFromLinks([github, gitlab], "p1"),
99+
projectId: "p1",
100+
repository: "wireshark/wireshark",
101+
query: "1",
102+
limit: 10,
103+
});
104+
expect(result.map((match) => match.url)).toEqual([github.url, gitlab.url]);
112105
});
113106

114107
it("keeps one row for a linked pull request the project listing already has", () => {
115108
const result = filterComposerPullRequestMatches({
116109
keyOf,
117110
entries: [entry(4, "2026-01-03")],
118-
linked: composerPullRequestsFromLinks(
119-
[link(" Owner/Repo ", 4, { host: " GitHub.COM " })],
120-
"p1",
121-
),
111+
linked: composerPullRequestsFromLinks([link("Owner/Repo", 4)], "p1"),
122112
projectId: "p1",
123113
repository: "owner/repo",
124114
query: "",

0 commit comments

Comments
 (0)