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

26 lines
695 B
Go
Raw Normal View History

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
},
SetupRepo: func(shell *Shell) {},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
2022-12-27 15:22:31 +11:00
assert.Model().CommitCount(0)
input.Press(keys.Universal.Quit)
2022-12-27 11:21:44 +11:00
input.Confirmation().
Title(Equals("")).
Content(Contains("Are you sure you want to quit?")).
Confirm()
},
})