1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-24 08:52:21 +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,

View File

@ -1,2 +0,0 @@
disableStartupPopups: true
confirmOnQuit: true

View File

@ -1 +0,0 @@
ref: refs/heads/master

View File

@ -1,10 +0,0 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[user]
email = CI@example.com
name = CI

View File

@ -1 +0,0 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@ -1,7 +0,0 @@
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
.DS_Store

View File

@ -1 +0,0 @@
0000000000000000000000000000000000000000 544efed4e669ec3bd64b44799175bffac95035f5 CI <CI@example.com> 1642239015 +1100 commit (initial): myfile1

View File

@ -1 +0,0 @@
0000000000000000000000000000000000000000 544efed4e669ec3bd64b44799175bffac95035f5 CI <CI@example.com> 1642239015 +1100 commit (initial): myfile1

View File

@ -1 +0,0 @@
544efed4e669ec3bd64b44799175bffac95035f5

View File

@ -1 +0,0 @@
test1

View File

@ -1 +0,0 @@
{"KeyEvents":[{"Timestamp":466,"Mod":0,"Key":256,"Ch":113},{"Timestamp":890,"Mod":0,"Key":13,"Ch":13}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]}

View File

@ -1,14 +0,0 @@
#!/bin/sh
set -e
cd $1
git init
git config user.email "CI@example.com"
git config user.name "CI"
echo test1 > myfile1
git add .
git commit -am "myfile1"

View File

@ -1,4 +0,0 @@
{
"description": "quit with a confirm",
"speed": 20
}