summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-02-19 13:54:15 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-02-19 15:48:09 +1100
commit13ee0f0a5d2a0b480a67518cdb211e10be5a3254 (patch)
treec18cfaa3b1a7549cf47e79189003800f7660a1e2
parent76a1b501f270e15cca37a54f64dbbee41ce37648 (diff)
migrate open to branches with cli arg test
-rw-r--r--pkg/integration/tests/branch/open_with_cli_arg.go18
-rw-r--r--pkg/integration/tests/tests_gen.go1
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/COMMIT_EDITMSG1
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/FETCH_HEAD0
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/HEAD1
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/config10
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/description1
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/indexbin65 -> 0 bytes
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/info/exclude7
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/logs/HEAD3
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/master1
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/other1
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/objects/45/fe0608335366a31a1ad6dacbdcc6b17d31a5b6bin118 -> 0 bytes
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904bin15 -> 0 bytes
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/refs/heads/master1
-rw-r--r--test/integration/gitArg/expected/repo/.git_keep/refs/heads/other1
-rw-r--r--test/integration/gitArg/recording.json1
-rw-r--r--test/integration/gitArg/setup.sh14
-rw-r--r--test/integration/gitArg/test.json5
19 files changed, 19 insertions, 47 deletions
diff --git a/pkg/integration/tests/branch/open_with_cli_arg.go b/pkg/integration/tests/branch/open_with_cli_arg.go
new file mode 100644
index 000000000..45029d603
--- /dev/null
+++ b/pkg/integration/tests/branch/open_with_cli_arg.go
@@ -0,0 +1,18 @@
+package branch
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var OpenWithCliArg = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Open straight to branches panel using a CLI arg",
+ ExtraCmdArgs: "branch",
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Branches().IsFocused()
+ },
+})
diff --git a/pkg/integration/tests/tests_gen.go b/pkg/integration/tests/tests_gen.go
index dedd93e6c..495fb16ed 100644
--- a/pkg/integration/tests/tests_gen.go
+++ b/pkg/integration/tests/tests_gen.go
@@ -27,6 +27,7 @@ var tests = []*components.IntegrationTest{
branch.CheckoutByName,
branch.Delete,
branch.DetachedHead,
+ branch.OpenWithCliArg,
branch.Rebase,
branch.RebaseAndDrop,
branch.RebaseDoesNotAutosquash,
diff --git a/test/integration/gitArg/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/gitArg/expected/repo/.git_keep/COMMIT_EDITMSG
deleted file mode 100644
index 907b30816..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/COMMIT_EDITMSG
+++ /dev/null
@@ -1 +0,0 @@
-blah
diff --git a/test/integration/gitArg/expected/repo/.git_keep/FETCH_HEAD b/test/integration/gitArg/expected/repo/.git_keep/FETCH_HEAD
deleted file mode 100644
index e69de29bb..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/FETCH_HEAD
+++ /dev/null
diff --git a/test/integration/gitArg/expected/repo/.git_keep/HEAD b/test/integration/gitArg/expected/repo/.git_keep/HEAD
deleted file mode 100644
index cb089cd89..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/HEAD
+++ /dev/null
@@ -1 +0,0 @@
-ref: refs/heads/master
diff --git a/test/integration/gitArg/expected/repo/.git_keep/config b/test/integration/gitArg/expected/repo/.git_keep/config
deleted file mode 100644
index 8ae104545..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/config
+++ /dev/null
@@ -1,10 +0,0 @@
-[core]
- repositoryformatversion = 0
- filemode = true
- bare = false
- logallrefupdates = true
- ignorecase = true
- precomposeunicode = true
-[user]
- email = CI@example.com
- name = CI
diff --git a/test/integration/gitArg/expected/repo/.git_keep/description b/test/integration/gitArg/expected/repo/.git_keep/description
deleted file mode 100644
index 498b267a8..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/description
+++ /dev/null
@@ -1 +0,0 @@
-Unnamed repository; edit this file 'description' to name the repository.
diff --git a/test/integration/gitArg/expected/repo/.git_keep/index b/test/integration/gitArg/expected/repo/.git_keep/index
deleted file mode 100644
index 65d675154..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/index
+++ /dev/null
Binary files differ
diff --git a/test/integration/gitArg/expected/repo/.git_keep/info/exclude b/test/integration/gitArg/expected/repo/.git_keep/info/exclude
deleted file mode 100644
index 8e9f2071f..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/info/exclude
+++ /dev/null
@@ -1,7 +0,0 @@
-# git ls-files --others --exclude-from=.git/info/exclude
-# Lines that start with '#' are comments.
-# For a project mostly in C, the following would be a good set of
-# exclude patterns (uncomment them if you want to use them):
-# *.[oa]
-# *~
-.DS_Store
diff --git a/test/integration/gitArg/expected/repo/.git_keep/logs/HEAD b/test/integration/gitArg/expected/repo/.git_keep/logs/HEAD
deleted file mode 100644
index eaac3a34d..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/logs/HEAD
+++ /dev/null
@@ -1,3 +0,0 @@
-0000000000000000000000000000000000000000 45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 CI <CI@example.com> 1654768290 +1000 commit (initial): blah
-45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 CI <CI@example.com> 1654768290 +1000 checkout: moving from master to other
-45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 CI <CI@example.com> 1654768291 +1000 checkout: moving from other to master
diff --git a/test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/master
deleted file mode 100644
index 12b2c7ee4..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/master
+++ /dev/null
@@ -1 +0,0 @@
-0000000000000000000000000000000000000000 45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 CI <CI@example.com> 1654768290 +1000 commit (initial): blah
diff --git a/test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/other b/test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/other
deleted file mode 100644
index d1b9aa145..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/other
+++ /dev/null
@@ -1 +0,0 @@
-0000000000000000000000000000000000000000 45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 CI <CI@example.com> 1654768290 +1000 branch: Created from HEAD
diff --git a/test/integration/gitArg/expected/repo/.git_keep/objects/45/fe0608335366a31a1ad6dacbdcc6b17d31a5b6 b/test/integration/gitArg/expected/repo/.git_keep/objects/45/fe0608335366a31a1ad6dacbdcc6b17d31a5b6
deleted file mode 100644
index 3171fbc5a..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/objects/45/fe0608335366a31a1ad6dacbdcc6b17d31a5b6
+++ /dev/null
Binary files differ
diff --git a/test/integration/gitArg/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/test/integration/gitArg/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
deleted file mode 100644
index adf64119a..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
+++ /dev/null
Binary files differ
diff --git a/test/integration/gitArg/expected/repo/.git_keep/refs/heads/master b/test/integration/gitArg/expected/repo/.git_keep/refs/heads/master
deleted file mode 100644
index 86a280f52..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/refs/heads/master
+++ /dev/null
@@ -1 +0,0 @@
-45fe0608335366a31a1ad6dacbdcc6b17d31a5b6
diff --git a/test/integration/gitArg/expected/repo/.git_keep/refs/heads/other b/test/integration/gitArg/expected/repo/.git_keep/refs/heads/other
deleted file mode 100644
index 86a280f52..000000000
--- a/test/integration/gitArg/expected/repo/.git_keep/refs/heads/other
+++ /dev/null
@@ -1 +0,0 @@
-45fe0608335366a31a1ad6dacbdcc6b17d31a5b6
diff --git a/test/integration/gitArg/recording.json b/test/integration/gitArg/recording.json
deleted file mode 100644
index 0a42da3cf..000000000
--- a/test/integration/gitArg/recording.json
+++ /dev/null
@@ -1 +0,0 @@
-{"KeyEvents":[{"Timestamp":620,"Mod":0,"Key":258,"Ch":0},{"Timestamp":995,"Mod":0,"Key":256,"Ch":32},{"Timestamp":1865,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file
diff --git a/test/integration/gitArg/setup.sh b/test/integration/gitArg/setup.sh
deleted file mode 100644
index d71cc83e4..000000000
--- a/test/integration/gitArg/setup.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $1
-
-git init
-
-git config user.email "CI@example.com"
-git config user.name "CI"
-
-git commit --allow-empty -m "blah"
-
-git checkout -b other
diff --git a/test/integration/gitArg/test.json b/test/integration/gitArg/test.json
deleted file mode 100644
index 0261df3ea..000000000
--- a/test/integration/gitArg/test.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "description": "Open lazygit to the branches panel",
- "speed": 10,
- "extraCmdArgs": "branch"
-}