summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/worktree
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-07-27 18:51:27 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-07-30 18:35:23 +1000
commitae66f720f56842d72f9c482d4da824d318e202ec (patch)
tree71fd10333d6362704b69db720a6f1e1100611c78 /pkg/integration/tests/worktree
parent9c15ba0c0bda6a752ae93d04d3365ae25d992391 (diff)
Update repo switch logic
We now always re-use the state of the repo if we're returning to it, and we always reset the windows to their default tabs. We reset to default tabs because it's easy to implement. If people want to: * have tab states be retained when switching * have tab states specific to the current repo retained when switching back Then we'll need to revisit this
Diffstat (limited to 'pkg/integration/tests/worktree')
-rw-r--r--pkg/integration/tests/worktree/reset_window_tabs.go (renamed from pkg/integration/tests/worktree/retained_window_focus.go)13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkg/integration/tests/worktree/retained_window_focus.go b/pkg/integration/tests/worktree/reset_window_tabs.go
index d518d6d1a..c24373be8 100644
--- a/pkg/integration/tests/worktree/retained_window_focus.go
+++ b/pkg/integration/tests/worktree/reset_window_tabs.go
@@ -5,8 +5,15 @@ import (
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
-var RetainedWindowFocus = NewIntegrationTest(NewIntegrationTestArgs{
- Description: "Verify that the focused context in each window is retained when switching worktrees",
+// This is verifying logic that is subject to change (we're just doing the easiest approach)
+// There are two other UX flows we could have:
+// 1) associate window tab states with the repo, so that when you switch back to a repo you get the same window tab states
+// 2) retain the same window tab states when switching repos
+// Option 1 is straightforward, but option 2 is harder because you'd need to deactivate any views containing dependent
+// content e.g. the sub-commits view.
+
+var ResetWindowTabs = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Verify that window tabs are reset whenever switching repos",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
@@ -39,7 +46,7 @@ var RetainedWindowFocus = NewIntegrationTest(NewIntegrationTestArgs{
// navigate back to the branches window
Press(keys.Universal.NextBlock)
- t.Views().Remotes().
+ t.Views().Branches().
IsFocused()
},
})