diff --git a/pkg/integration/tests/patch_building/move_to_index.go b/pkg/integration/tests/main_view/move_patch_to_index.go similarity index 68% rename from pkg/integration/tests/patch_building/move_to_index.go rename to pkg/integration/tests/main_view/move_patch_to_index.go index f51ad4819..d6fae2f32 100644 --- a/pkg/integration/tests/patch_building/move_to_index.go +++ b/pkg/integration/tests/main_view/move_patch_to_index.go @@ -1,11 +1,11 @@ -package patch_building +package main_view import ( "github.com/jesseduffield/lazygit/pkg/config" . "github.com/jesseduffield/lazygit/pkg/integration/components" ) -var MoveToIndex = NewIntegrationTest(NewIntegrationTestArgs{ +var MovePatchToIndex = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Move a patch from a commit to the index", ExtraCmdArgs: []string{}, Skip: false, @@ -30,39 +30,32 @@ var MoveToIndex = NewIntegrationTest(NewIntegrationTestArgs{ Contains("file1"), Contains("file2"), ). - SelectNextItem(). + Press(keys.Universal.FocusMainView) + + t.Views().Main(). + IsFocused(). + SelectedLines(Contains("+file1 content")). PressPrimaryAction() t.Views().Information().Content(Contains("Building patch")) - t.Views().Secondary().Content(Contains("+file1 content")) t.Common().SelectPatchOption(Contains("Move patch out into index")) - t.Views().Files(). - Lines( - Contains("A").Contains("file1"), - ) - - t.Views().CommitFiles(). - IsFocused(). - Lines( - Contains("file2").IsSelected(), - ). - PressEscape() - + t.Views().Files().Lines( + /* EXPECTED: + Contains("A").Contains("file1"), + ACTUAL: */ + Contains("M").Contains("file1"), + ) t.Views().Main(). + IsFocused(). Content(Contains("+file2 content")) + t.Views().Commits().Lines( + Contains("first commit").IsSelected(), + ) - t.Views().Commits(). - Lines( - Contains("first commit").IsSelected(), - ) - - t.Views().Files(). - Focus() - - t.Views().Secondary(). - Content(Contains("file1 content")) + t.Views().Files().Focus() + t.Views().Secondary().Content(Contains("file1 content")) }, }) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 936d9aa60..39c4b9420 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -410,6 +410,7 @@ var tests = []*components.IntegrationTest{ main_view.KeepSelectionAfterMovingPatchOut, main_view.KeepSelectionVisibleWhenDiffShrinks, main_view.MoveOnWhenThePatchMarksRewrapTheDiff, + main_view.MovePatchToIndex, main_view.NavigateByHunkAndFile, main_view.NoSelectionOverABinaryDiff, main_view.NoSelectionOverACommitLog, @@ -477,7 +478,6 @@ var tests = []*components.IntegrationTest{ patch_building.MoveRangeToIndex, patch_building.MoveToEarlierCommit, patch_building.MoveToEarlierCommitFromAddedFile, - patch_building.MoveToIndex, patch_building.MoveToIndexFromAddedFileWithConflict, patch_building.MoveToIndexPartOfAdjacentAddedLines, patch_building.MoveToIndexPartial,