From 13ee0f0a5d2a0b480a67518cdb211e10be5a3254 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 19 Feb 2023 13:54:15 +1100 Subject: [PATCH] migrate open to branches with cli arg test --- .../tests/branch/open_with_cli_arg.go | 18 ++++++++++++++++++ pkg/integration/tests/tests_gen.go | 1 + .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../gitArg/expected/repo/.git_keep/FETCH_HEAD | 0 .../gitArg/expected/repo/.git_keep/HEAD | 1 - .../gitArg/expected/repo/.git_keep/config | 10 ---------- .../expected/repo/.git_keep/description | 1 - .../gitArg/expected/repo/.git_keep/index | Bin 65 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 ------- .../gitArg/expected/repo/.git_keep/logs/HEAD | 3 --- .../repo/.git_keep/logs/refs/heads/master | 1 - .../repo/.git_keep/logs/refs/heads/other | 1 - .../45/fe0608335366a31a1ad6dacbdcc6b17d31a5b6 | Bin 118 -> 0 bytes .../4b/825dc642cb6eb9a060e54bf8d69288fbee4904 | Bin 15 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../expected/repo/.git_keep/refs/heads/other | 1 - test/integration/gitArg/recording.json | 1 - test/integration/gitArg/setup.sh | 14 -------------- test/integration/gitArg/test.json | 5 ----- 19 files changed, 19 insertions(+), 47 deletions(-) create mode 100644 pkg/integration/tests/branch/open_with_cli_arg.go delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/config delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/description delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/index delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/logs/refs/heads/other delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/objects/45/fe0608335366a31a1ad6dacbdcc6b17d31a5b6 delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/gitArg/expected/repo/.git_keep/refs/heads/other delete mode 100644 test/integration/gitArg/recording.json delete mode 100644 test/integration/gitArg/setup.sh delete mode 100644 test/integration/gitArg/test.json 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 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 65d675154f23ffb2d0196e017d44a5e7017550f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmZ?q402{*U|<4bhL9jvS0E+HV4z^Y<=qr}%;|LA&IJiiy? 1654768290 +1000 commit (initial): blah -45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 CI 1654768290 +1000 checkout: moving from master to other -45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 45fe0608335366a31a1ad6dacbdcc6b17d31a5b6 CI 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 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 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 3171fbc5aa45b9978e09873788bb3ce33dc82d45..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118 zcmV-+0Ez#20gcT;3c@fDKvCB@#q0%{#K|}T5uvLdBa=?4&=4sRdi?eXZa)uxX|;Yj zc)DNuW(K4Z;#8PIQ8rB(87-2|GI0tbvzk#ta{1Snw!tvMa~R*Y=lWgkR$6_5=SUBh YkPxmO5#3qONw+__(={*d0IxPHz}+Y{8UO$Q 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 adf64119a33d7621aeeaa505d30adb58afaa5559..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15 Wcmb