1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-25 22:32:13 +02:00

migrate confirm-on-quit integration test

This commit is contained in:
Jesse Duffield
2022-12-20 23:08:39 +11:00
parent dde70486a1
commit f910b42c9c
20 changed files with 27 additions and 45 deletions

View File

@@ -0,0 +1,25 @@
package misc
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var ConfirmOnQuit = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Quitting with a confirm prompt",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.ConfirmOnQuit = true
config.UserConfig.Gui.Theme.ActiveBorderColor = []string{"red"}
},
SetupRepo: func(shell *Shell) {},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
assert.CommitCount(0)
input.PressKeys(keys.Universal.Quit)
assert.InConfirm()
assert.MatchCurrentViewContent(Contains("Are you sure you want to quit?"))
input.Confirm()
},
})

View File

@@ -18,6 +18,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/integration/tests/custom_commands"
"github.com/jesseduffield/lazygit/pkg/integration/tests/file"
"github.com/jesseduffield/lazygit/pkg/integration/tests/interactive_rebase"
"github.com/jesseduffield/lazygit/pkg/integration/tests/misc"
"github.com/jesseduffield/lazygit/pkg/integration/tests/stash"
)
@@ -25,6 +26,7 @@ import (
// be sure to add it to this list.
var tests = []*components.IntegrationTest{
misc.ConfirmOnQuit,
bisect.Basic,
bisect.FromOtherBranch,
branch.CheckoutByName,