1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-26 05:37:18 +02:00
lazygit/pkg/integration/tests/misc/confirm_on_quit.go
2022-12-20 23:08:39 +11:00

26 lines
758 B
Go

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()
},
})