summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/branch/unset_upstream.go
diff options
context:
space:
mode:
authorLuka Markušić <markusicluka@gmail.com>2023-10-22 12:00:22 +0200
committerLuka Markušić <markusicluka@gmail.com>2023-11-04 23:18:38 +0100
commitbb705d91a44bfe877edb40dbf4d4f164ad923d7f (patch)
tree126ae3f92ce86eae47433ceed352416c3c342118 /pkg/integration/tests/branch/unset_upstream.go
parent1d1b8cc01f87bb3495426ac8d81d97573f6840d4 (diff)
Rename integration test "ResetUpstream"
We are unsetting upstream in it, not resetting to upstream
Diffstat (limited to 'pkg/integration/tests/branch/unset_upstream.go')
-rw-r--r--pkg/integration/tests/branch/unset_upstream.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkg/integration/tests/branch/unset_upstream.go b/pkg/integration/tests/branch/unset_upstream.go
new file mode 100644
index 000000000..c38c0cd58
--- /dev/null
+++ b/pkg/integration/tests/branch/unset_upstream.go
@@ -0,0 +1,36 @@
+package branch
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var UnsetUpstream = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Reset the upstream of a branch",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ shell.EmptyCommit("one")
+ shell.CloneIntoRemote("origin")
+ shell.SetBranchUpstream("master", "origin/master")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Branches().
+ Focus().
+ Press(keys.Universal.NextScreenMode). // we need to enlargen the window to see the upstream
+ Lines(
+ Contains("master").Contains("origin master").IsSelected(),
+ ).
+ Press(keys.Branches.SetUpstream).
+ Tap(func() {
+ t.ExpectPopup().Menu().
+ Title(Equals("Upstream options")).
+ Select(Contains("Unset upstream of selected branch")).
+ Confirm()
+ }).
+ Lines(
+ Contains("master").DoesNotContain("origin master").IsSelected(),
+ )
+ },
+})