Skip to content

Commit

Permalink
Integration test for disabling tab switching w/jump keys
Browse files Browse the repository at this point in the history
  • Loading branch information
hgreenstein committed Sep 20, 2024
1 parent 9d1fcb7 commit ad25bb3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/integration/tests/test_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ var tests = []*components.IntegrationTest{
tag.ForceTagLightweight,
tag.Reset,
ui.Accordion,
ui.DisableSwitchTabWithPanelJumpKeys,
ui.DoublePopup,
ui.EmptyMenu,
ui.KeybindingSuggestionsWhenSwitchingRepos,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package ui

import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)

var DisableSwitchTabWithPanelJumpKeys = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Disable switching tabs with the panel jump keys",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Gui.SwitchTabsWithPanelJumpKeys = false
},
SetupRepo: func(shell *Shell) {
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Status().Focus().
Press(keys.Universal.JumpToBlock[1])
t.Views().Files().IsFocused().
Press(keys.Universal.JumpToBlock[1])

// Despite jumping to an already focused panel,
// the tab should not change from the base files view
t.Views().Files().IsFocused()
},
})

0 comments on commit ad25bb3

Please sign in to comment.