summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/sync/push_follow_tags.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-02-21 21:49:48 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-02-21 21:50:03 +1100
commitbfde06d049f99cb8a544d56e24bf5412b7628bcf (patch)
tree09412e5eca11f428e800fa2079fe0d9bcc3ca650 /pkg/integration/tests/sync/push_follow_tags.go
parent6b8abb7887000a1f69b664841dce4385ec79289b (diff)
migrate push tests
Diffstat (limited to 'pkg/integration/tests/sync/push_follow_tags.go')
-rw-r--r--pkg/integration/tests/sync/push_follow_tags.go56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkg/integration/tests/sync/push_follow_tags.go b/pkg/integration/tests/sync/push_follow_tags.go
new file mode 100644
index 000000000..92a1074dc
--- /dev/null
+++ b/pkg/integration/tests/sync/push_follow_tags.go
@@ -0,0 +1,56 @@
+package sync
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var PushFollowTags = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Push with --follow-tags configured in git config",
+ ExtraCmdArgs: "",
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {
+ },
+ SetupRepo: func(shell *Shell) {
+ shell.EmptyCommit("one")
+
+ shell.CloneIntoRemote("origin")
+
+ shell.SetBranchUpstream("master", "origin/master")
+
+ shell.EmptyCommit("two")
+ shell.CreateAnnotatedTag("mytag", "message", "HEAD")
+
+ shell.SetConfig("push.followTags", "true")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Status().Content(Contains("↑1 repo → master"))
+
+ t.Views().Files().
+ IsFocused().
+ Press(keys.Universal.Push)
+
+ t.Views().Status().Content(Contains("✓ repo → master"))
+
+ t.Views().Remotes().
+ Focus().
+ Lines(
+ Contains("origin"),
+ ).
+ PressEnter()
+
+ t.Views().RemoteBranches().
+ IsFocused().
+ Lines(
+ Contains("master"),
+ ).
+ PressEnter()
+
+ t.Views().SubCommits().
+ IsFocused().
+ Lines(
+ Contains("two").Contains("mytag"),
+ Contains("one"),
+ )
+ },
+})