mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
package file
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var ExcludeGitignore = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Failed attempt at excluding and ignoring the .gitignore file",
|
|
ExtraCmdArgs: "",
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {
|
|
},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.CreateFile(".gitignore", "")
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Files().
|
|
IsFocused().
|
|
Lines(
|
|
Contains(`?? .gitignore`).IsSelected(),
|
|
).
|
|
Press(keys.Files.IgnoreFile).
|
|
Tap(func() {
|
|
t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .git/info/exclude")).Confirm()
|
|
|
|
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot exclude .gitignore")).Confirm()
|
|
}).
|
|
Press(keys.Files.IgnoreFile).
|
|
Tap(func() {
|
|
t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .gitignore")).Confirm()
|
|
|
|
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot ignore .gitignore")).Confirm()
|
|
})
|
|
|
|
t.FileSystem().FileContainsContent(".gitignore", Equals(""))
|
|
t.FileSystem().FileContainsContent(".git/info/exclude", DoesNotContain(".gitignore"))
|
|
},
|
|
})
|