diff --git a/pkg/integration/tests/tests_gen.go b/pkg/integration/tests/tests_gen.go index 27ca095c1..7163e9fdf 100644 --- a/pkg/integration/tests/tests_gen.go +++ b/pkg/integration/tests/tests_gen.go @@ -22,6 +22,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/integration/tests/sync" "github.com/jesseduffield/lazygit/pkg/integration/tests/tag" "github.com/jesseduffield/lazygit/pkg/integration/tests/undo" + "github.com/jesseduffield/lazygit/pkg/integration/tests/ui" ) var tests = []*components.IntegrationTest{ @@ -101,4 +102,5 @@ var tests = []*components.IntegrationTest{ tag.Reset, undo.UndoCheckoutAndDrop, undo.UndoDrop, + ui.SwitchTabFromMenu, } diff --git a/pkg/integration/tests/ui/switch_tab_from_menu.go b/pkg/integration/tests/ui/switch_tab_from_menu.go new file mode 100644 index 000000000..0a5b56c23 --- /dev/null +++ b/pkg/integration/tests/ui/switch_tab_from_menu.go @@ -0,0 +1,27 @@ +package ui + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var SwitchTabFromMenu = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Switch tab via the options menu", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + config.UserConfig.Git.AutoFetch = false + }, + SetupRepo: func(shell *Shell) { + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Files().IsFocused(). + Press(keys.Universal.OptionMenuAlt1) + + t.ExpectPopup().Menu().Title(Equals("Menu")). + Select(Contains("next tab")). + Confirm() + + t.Views().Submodules().IsFocused() + }, +}) diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/switchTabFromMenu/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index dc3ab4abe..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -file0 diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/FETCH_HEAD b/test/integration/switchTabFromMenu/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/HEAD b/test/integration/switchTabFromMenu/expected/repo/.git_keep/HEAD deleted file mode 100644 index b44fbb2b7..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -72068e9a852a790a9b867e8b5d21cb4ede3ba4d7 diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/config b/test/integration/switchTabFromMenu/expected/repo/.git_keep/config deleted file mode 100644 index 596ebaeb3..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true -[user] - email = CI@example.com - name = CI diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/description b/test/integration/switchTabFromMenu/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/switchTabFromMenu/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/switchTabFromMenu/expected/repo/.git_keep/index b/test/integration/switchTabFromMenu/expected/repo/.git_keep/index deleted file mode 100644 index 91ccc35d0..000000000 Binary files a/test/integration/switchTabFromMenu/expected/repo/.git_keep/index and /dev/null differ diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/info/exclude b/test/integration/switchTabFromMenu/expected/repo/.git_keep/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,6 +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] -# *~ diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/logs/HEAD b/test/integration/switchTabFromMenu/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 06099d5d9..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 e0aeb3ba0b32392aaf7d88a5190aca76be967225 CI 1623779969 +0200 commit (initial): file0 -e0aeb3ba0b32392aaf7d88a5190aca76be967225 72068e9a852a790a9b867e8b5d21cb4ede3ba4d7 CI 1623779969 +0200 commit: file0 -72068e9a852a790a9b867e8b5d21cb4ede3ba4d7 72068e9a852a790a9b867e8b5d21cb4ede3ba4d7 CI 1623779976 +0200 checkout: moving from master to 0.0.2 diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/switchTabFromMenu/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index e0e6c2284..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 e0aeb3ba0b32392aaf7d88a5190aca76be967225 CI 1623779969 +0200 commit (initial): file0 -e0aeb3ba0b32392aaf7d88a5190aca76be967225 72068e9a852a790a9b867e8b5d21cb4ede3ba4d7 CI 1623779969 +0200 commit: file0 diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/09/767bd3484e22b41138116992cc1cb5bc45fb7f b/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/09/767bd3484e22b41138116992cc1cb5bc45fb7f deleted file mode 100644 index d09fb5ad6..000000000 Binary files a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/09/767bd3484e22b41138116992cc1cb5bc45fb7f and /dev/null differ diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/72/068e9a852a790a9b867e8b5d21cb4ede3ba4d7 b/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/72/068e9a852a790a9b867e8b5d21cb4ede3ba4d7 deleted file mode 100644 index 68bf82fc1..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/72/068e9a852a790a9b867e8b5d21cb4ede3ba4d7 +++ /dev/null @@ -1,2 +0,0 @@ -xK -0@] L>cNИR"x|{7oxWzkЖ2]|pXRc,t%!ŰddK cBxCOOSMn"Q$}5`:95\u~P49c \ No newline at end of file diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/c4/534c51b41b7c85f4fad4657885792d95797e8c b/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/c4/534c51b41b7c85f4fad4657885792d95797e8c deleted file mode 100644 index 58277c3d5..000000000 Binary files a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/c4/534c51b41b7c85f4fad4657885792d95797e8c and /dev/null differ diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/e0/aeb3ba0b32392aaf7d88a5190aca76be967225 b/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/e0/aeb3ba0b32392aaf7d88a5190aca76be967225 deleted file mode 100644 index 06e1631ba..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/e0/aeb3ba0b32392aaf7d88a5190aca76be967225 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0@Q9$LDzf`!Dn?ZHtxi$ !bHPECVJORn0,>xzN]Y7+t \ No newline at end of file diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894..000000000 Binary files a/test/integration/switchTabFromMenu/expected/repo/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /dev/null differ diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/heads/master b/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index b44fbb2b7..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -72068e9a852a790a9b867e8b5d21cb4ede3ba4d7 diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/tags/0.0.1 b/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/tags/0.0.1 deleted file mode 100644 index 2e5dbd7ed..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/tags/0.0.1 +++ /dev/null @@ -1 +0,0 @@ -e0aeb3ba0b32392aaf7d88a5190aca76be967225 diff --git a/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/tags/0.0.2 b/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/tags/0.0.2 deleted file mode 100644 index b44fbb2b7..000000000 --- a/test/integration/switchTabFromMenu/expected/repo/.git_keep/refs/tags/0.0.2 +++ /dev/null @@ -1 +0,0 @@ -72068e9a852a790a9b867e8b5d21cb4ede3ba4d7 diff --git a/test/integration/switchTabFromMenu/expected/repo/file0 b/test/integration/switchTabFromMenu/expected/repo/file0 deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/switchTabFromMenu/expected/repo/file1 b/test/integration/switchTabFromMenu/expected/repo/file1 deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/switchTabFromMenu/recording.json b/test/integration/switchTabFromMenu/recording.json deleted file mode 100644 index eeb6b93a5..000000000 --- a/test/integration/switchTabFromMenu/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":1446,"Mod":0,"Key":259,"Ch":0},{"Timestamp":1701,"Mod":0,"Key":256,"Ch":120},{"Timestamp":2661,"Mod":0,"Key":256,"Ch":47},{"Timestamp":3149,"Mod":0,"Key":256,"Ch":112},{"Timestamp":3301,"Mod":0,"Key":256,"Ch":114},{"Timestamp":3349,"Mod":0,"Key":256,"Ch":101},{"Timestamp":3509,"Mod":0,"Key":256,"Ch":118},{"Timestamp":3573,"Mod":0,"Key":256,"Ch":105},{"Timestamp":3653,"Mod":0,"Key":256,"Ch":111},{"Timestamp":3757,"Mod":0,"Key":256,"Ch":117},{"Timestamp":3837,"Mod":0,"Key":256,"Ch":115},{"Timestamp":4013,"Mod":0,"Key":256,"Ch":32},{"Timestamp":4157,"Mod":0,"Key":256,"Ch":116},{"Timestamp":4213,"Mod":0,"Key":256,"Ch":97},{"Timestamp":4268,"Mod":0,"Key":256,"Ch":98},{"Timestamp":4533,"Mod":0,"Key":13,"Ch":13},{"Timestamp":5140,"Mod":0,"Key":13,"Ch":13},{"Timestamp":5860,"Mod":0,"Key":258,"Ch":0},{"Timestamp":6157,"Mod":0,"Key":256,"Ch":32},{"Timestamp":6701,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":79}]} \ No newline at end of file diff --git a/test/integration/switchTabFromMenu/setup.sh b/test/integration/switchTabFromMenu/setup.sh deleted file mode 100644 index e6f5ec24f..000000000 --- a/test/integration/switchTabFromMenu/setup.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -touch file0 -git add file0 -git commit -am file0 -git tag 0.0.1 - -touch file1 -git add file1 -git commit -am file0 -git tag 0.0.2 diff --git a/test/integration/switchTabFromMenu/test.json b/test/integration/switchTabFromMenu/test.json deleted file mode 100644 index d6be0d1e7..000000000 --- a/test/integration/switchTabFromMenu/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "Change tabs from Options menu", "speed": 1 }