Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): scope PR state to the thread branch #4460

Mergedjuliusmarmingemerged 5 commits intomain fromrefs/pull/4460/headmerged by juliusmarminge View on GitHub

Showing 8 changed files with 42 additions and 2 deletions (loading 5).

x
0 of 8 viewed, 8 left
30 additions and 0 deletionsapps/web/src/components/BranchToolbar.logic.test.tsModified
View file
@@ -9,6 +9,7 @@
resolveDraftEnvModeAfterBranchChange,
resolveEffectiveEnvMode,
resolveEnvModeLabel,
+ resolveBranchToolbarPrBranch,
resolveBranchToolbarValue,
resolveLockedWorkspaceLabel,
resolveLocalCheckoutBranchMismatch,
@@ -173,6 +174,35 @@
});
});
​
+describe("resolveBranchToolbarPrBranch", () => {
+ it("uses the explicit thread branch when it matches the displayed branch", () => {
+ expect(
+ resolveBranchToolbarPrBranch({
+ activeThreadBranch: "feature/current",
+ resolvedActiveBranch: "feature/current",
+ }),
+ ).toBe("feature/current");
+ });
+​
+ it("hides PR state while an optimistic branch switch is in flight", () => {
+ expect(
+ resolveBranchToolbarPrBranch({
+ activeThreadBranch: "feature/current",
+ resolvedActiveBranch: "feature/next",
+ }),
+ ).toBeNull();