mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Remove obsolete tests
These only ran for git versions that we no longer support.
This commit is contained in:
@ -1,78 +0,0 @@
|
||||
package patch_building
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var MoveToEarlierCommitNoKeepEmpty = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Move a patch from a commit to an earlier commit, for older git versions that don't keep the empty commit",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
GitVersion: Before("2.26.0"),
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.CreateDir("dir")
|
||||
shell.CreateFileAndAdd("dir/file1", "file1 content")
|
||||
shell.CreateFileAndAdd("dir/file2", "file2 content")
|
||||
shell.Commit("first commit")
|
||||
|
||||
shell.CreateFileAndAdd("unrelated-file", "")
|
||||
shell.Commit("destination commit")
|
||||
|
||||
shell.UpdateFileAndAdd("dir/file1", "file1 content with old changes")
|
||||
shell.DeleteFileAndAdd("dir/file2")
|
||||
shell.CreateFileAndAdd("dir/file3", "file3 content")
|
||||
shell.Commit("commit to move from")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("commit to move from").IsSelected(),
|
||||
Contains("destination commit"),
|
||||
Contains("first commit"),
|
||||
).
|
||||
PressEnter()
|
||||
|
||||
t.Views().CommitFiles().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("dir").IsSelected(),
|
||||
Contains(" M file1"),
|
||||
Contains(" D file2"),
|
||||
Contains(" A file3"),
|
||||
).
|
||||
PressPrimaryAction().
|
||||
PressEscape()
|
||||
|
||||
t.Views().Information().Content(Contains("Building patch"))
|
||||
|
||||
t.Views().Commits().
|
||||
IsFocused().
|
||||
SelectNextItem()
|
||||
|
||||
t.Common().SelectPatchOption(Contains("Move patch to selected commit"))
|
||||
|
||||
t.Views().Commits().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("destination commit"),
|
||||
Contains("first commit").IsSelected(),
|
||||
).
|
||||
SelectPreviousItem().
|
||||
PressEnter()
|
||||
|
||||
t.Views().CommitFiles().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Equals("▼ /").IsSelected(),
|
||||
Equals(" ▼ dir"),
|
||||
Equals(" M file1"),
|
||||
Equals(" D file2"),
|
||||
Equals(" A file3"),
|
||||
Equals(" A unrelated-file"),
|
||||
).
|
||||
PressEscape()
|
||||
},
|
||||
})
|
@ -1,77 +0,0 @@
|
||||
package patch_building
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var MoveToNewCommitBeforeNoKeepEmpty = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Move a patch from a commit to a new commit before the original one, for older git versions that don't keep the empty commit",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
GitVersion: Before("2.26.0"),
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.CreateDir("dir")
|
||||
shell.CreateFileAndAdd("dir/file1", "file1 content")
|
||||
shell.CreateFileAndAdd("dir/file2", "file2 content")
|
||||
shell.Commit("first commit")
|
||||
|
||||
shell.UpdateFileAndAdd("dir/file1", "file1 content with old changes")
|
||||
shell.DeleteFileAndAdd("dir/file2")
|
||||
shell.CreateFileAndAdd("dir/file3", "file3 content")
|
||||
shell.Commit("commit to move from")
|
||||
|
||||
shell.UpdateFileAndAdd("dir/file1", "file1 content with new changes")
|
||||
shell.Commit("third commit")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("third commit").IsSelected(),
|
||||
Contains("commit to move from"),
|
||||
Contains("first commit"),
|
||||
).
|
||||
SelectNextItem().
|
||||
PressEnter()
|
||||
|
||||
t.Views().CommitFiles().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("dir").IsSelected(),
|
||||
Contains(" M file1"),
|
||||
Contains(" D file2"),
|
||||
Contains(" A file3"),
|
||||
).
|
||||
PressPrimaryAction().
|
||||
PressEscape()
|
||||
|
||||
t.Views().Information().Content(Contains("Building patch"))
|
||||
|
||||
t.Common().SelectPatchOption(Contains("Move patch into new commit before the original commit"))
|
||||
|
||||
t.ExpectPopup().CommitMessagePanel().
|
||||
InitialText(Equals("")).
|
||||
Type("new commit").Confirm()
|
||||
|
||||
t.Views().Commits().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("third commit"),
|
||||
Contains("new commit").IsSelected(),
|
||||
Contains("first commit"),
|
||||
).
|
||||
PressEnter()
|
||||
|
||||
t.Views().CommitFiles().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("dir").IsSelected(),
|
||||
Contains(" M file1"),
|
||||
Contains(" D file2"),
|
||||
Contains(" A file3"),
|
||||
).
|
||||
PressEscape()
|
||||
},
|
||||
})
|
@ -306,7 +306,6 @@ var tests = []*components.IntegrationTest{
|
||||
patch_building.MoveRangeToIndex,
|
||||
patch_building.MoveToEarlierCommit,
|
||||
patch_building.MoveToEarlierCommitFromAddedFile,
|
||||
patch_building.MoveToEarlierCommitNoKeepEmpty,
|
||||
patch_building.MoveToIndex,
|
||||
patch_building.MoveToIndexFromAddedFileWithConflict,
|
||||
patch_building.MoveToIndexPartOfAdjacentAddedLines,
|
||||
@ -318,7 +317,6 @@ var tests = []*components.IntegrationTest{
|
||||
patch_building.MoveToLaterCommitPartialHunk,
|
||||
patch_building.MoveToNewCommit,
|
||||
patch_building.MoveToNewCommitBefore,
|
||||
patch_building.MoveToNewCommitBeforeNoKeepEmpty,
|
||||
patch_building.MoveToNewCommitFromAddedFile,
|
||||
patch_building.MoveToNewCommitFromDeletedFile,
|
||||
patch_building.MoveToNewCommitInLastCommitOfStackedBranch,
|
||||
|
Reference in New Issue
Block a user