forked from jesseduffield/lazygit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more git ignore stuff in integration test
- Loading branch information
1 parent
31bdd27
commit 8a1c763
Showing
19 changed files
with
64 additions
and
86 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package file | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var GitIgnore = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Verify that we can't ignore the .gitignore file, then ignore/exclude other files", | ||
ExtraCmdArgs: "", | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) { | ||
}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.CreateFile(".gitignore", "") | ||
shell.CreateFile("toExclude", "") | ||
shell.CreateFile("toIgnore", "") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Files(). | ||
IsFocused(). | ||
Lines( | ||
Contains(`?? .gitignore`).IsSelected(), | ||
Contains(`?? toExclude`), | ||
Contains(`?? toIgnore`), | ||
). | ||
Press(keys.Files.IgnoreFile). | ||
// ensure we can't exclude the .gitignore file | ||
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). | ||
// ensure we can't ignore the .gitignore file | ||
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().FileContent(".gitignore", Equals("")) | ||
t.FileSystem().FileContent(".git/info/exclude", DoesNotContain(".gitignore")) | ||
}). | ||
SelectNextItem(). | ||
Press(keys.Files.IgnoreFile). | ||
// exclude a file | ||
Tap(func() { | ||
t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .git/info/exclude")).Confirm() | ||
|
||
t.FileSystem().FileContent(".gitignore", Equals("")) | ||
t.FileSystem().FileContent(".git/info/exclude", Contains("toExclude")) | ||
}). | ||
SelectNextItem(). | ||
Press(keys.Files.IgnoreFile). | ||
// ignore a file | ||
Tap(func() { | ||
t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .gitignore")).Confirm() | ||
|
||
t.FileSystem().FileContent(".gitignore", Equals("toIgnore\n")) | ||
t.FileSystem().FileContent(".git/info/exclude", Contains("toExclude")) | ||
}) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
test/integration/excludeMenu/expected/repo/.git_keep/COMMIT_EDITMSG
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
test/integration/excludeMenu/expected/repo/.git_keep/config
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/integration/excludeMenu/expected/repo/.git_keep/description
This file was deleted.
Oops, something went wrong.
Binary file not shown.
9 changes: 0 additions & 9 deletions
9
test/integration/excludeMenu/expected/repo/.git_keep/info/exclude
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/integration/excludeMenu/expected/repo/.git_keep/logs/refs/heads/master
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-123 Bytes
...ion/excludeMenu/expected/repo/.git_keep/objects/12/9cdae0c4ccd050e8398bcb18b2ce1e4a5626f9
Binary file not shown.
Binary file removed
BIN
-15 Bytes
...ion/excludeMenu/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
Binary file not shown.
1 change: 0 additions & 1 deletion
1
test/integration/excludeMenu/expected/repo/.git_keep/refs/heads/master
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.