2022-12-20 23:08:39 +11:00
|
|
|
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",
|
2023-05-21 17:00:29 +10:00
|
|
|
ExtraCmdArgs: []string{},
|
2022-12-20 23:08:39 +11:00
|
|
|
Skip: false,
|
|
|
|
SetupConfig: func(config *config.AppConfig) {
|
|
|
|
config.UserConfig.ConfirmOnQuit = true
|
|
|
|
},
|
|
|
|
SetupRepo: func(shell *Shell) {},
|
2022-12-27 21:47:37 +11:00
|
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
2022-12-27 21:35:36 +11:00
|
|
|
t.Views().Files().
|
2022-12-27 16:27:36 +11:00
|
|
|
IsFocused().
|
|
|
|
Press(keys.Universal.Quit)
|
|
|
|
|
2022-12-28 11:00:22 +11:00
|
|
|
t.ExpectPopup().Confirmation().
|
2022-12-27 10:50:00 +11:00
|
|
|
Title(Equals("")).
|
|
|
|
Content(Contains("Are you sure you want to quit?")).
|
|
|
|
Confirm()
|
2022-12-20 23:08:39 +11:00
|
|
|
},
|
|
|
|
})
|