feat(pull-requests): link multiple pull requests to threads (#10839)
This commit is contained in:
1 parent
383cc40f4d
commit
afb84898be
172 files changed
+12063
-914
No files matched your search
@@ -1420,6 +1420,42 @@ describe("cached pull request detail", () => {
|
||||
expect(readPullRequestDetailSnapshot(makeStorage(), "env-2", reference)).toBeNull();
|
||||
});
|
||||
|
||||
it("isolates stored and displayed details between hosts with the same repository and number", () => {
|
||||
const storage = makeStorage();
|
||||
const publicRef = { ...reference, host: "github.com" };
|
||||
const enterpriseRef = { ...reference, host: "github.example.com" };
|
||||
const publicDetail = detail();
|
||||
const enterpriseDetail = detail({
|
||||
title: "Enterprise change",
|
||||
url: "https://github.example.com/acme/web/pull/7",
|
||||
});
|
||||
writePullRequestDetailSnapshot(storage, "env-1", publicRef, publicDetail);
|
||||
expect(readPullRequestDetailSnapshot(storage, "env-1", enterpriseRef)).toBeNull();
|
||||
writePullRequestDetailSnapshot(storage, "env-1", enterpriseRef, enterpriseDetail);
|
||||
expect(readPullRequestDetailSnapshot(storage, "env-1", publicRef)?.title).toBe(
|
||||
publicDetail.title,
|
||||
);
|
||||
expect(readPullRequestDetailSnapshot(storage, "env-1", enterpriseRef)?.title).toBe(
|
||||
enterpriseDetail.title,
|
||||
);
|
||||
expect(
|
||||
resolveDisplayedPullRequestDetail({
|
||||
live: null,
|
||||
cached: publicDetail,
|
||||
reference: enterpriseRef,
|
||||
}),
|
||||
).toBeNull();
|
||||
expect(
|
||||
resolveDisplayedPullRequestDetail({
|
||||
live: null,
|
||||
cached: enterpriseDetail,
|
||||
reference: enterpriseRef,
|
||||
}),
|
||||
).toBe(enterpriseDetail);
|
||||
writePullRequestDetailSnapshot(storage, "env-1", enterpriseRef, publicDetail);
|
||||
expect(readPullRequestDetailSnapshot(storage, "env-1", enterpriseRef)).toBeNull();
|
||||
});
|
||||
|
||||
it("shrugs off corrupt storage and no storage at all", () => {
|
||||
const storage = makeStorage();
|
||||
storage.setItem("t3.pullRequests.detail:env-1:project-1:acme/web#7", "{not json");
|
||||
|
||||
Reference in new issue
Block a user