Skip to content

Commit

Permalink
fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseduffield committed Apr 14, 2023
1 parent 275ed12 commit 7f5465a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pkg/integration/tests/conflicts/undo_choose_hunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ var UndoChooseHunk = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().MergeConflicts().
IsFocused().
Content(Contains("<<<<<<< HEAD\nFirst Change")).
// explicitly asserting on the selection because sometimes the content renders
// before the selection is ready for user input
SelectedLines(
Contains("<<<<<<< HEAD"),
Contains("First Change"),
Contains("======="),
).
PressPrimaryAction().
// choosing the first hunk
Content(DoesNotContain("<<<<<<< HEAD\nFirst Change")).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ var ApplyInReverseWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
).
// Add both files to the patch; the first will conflict, the second won't
PressPrimaryAction().
Tap(func() {
t.Views().Information().Content(Contains("building patch"))

t.Views().PatchBuildingSecondary().Content(
Contains("+more file1 content"))
}).
SelectNextItem().
PressPrimaryAction()

t.Views().Information().Content(Contains("building patch"))

t.Views().PatchBuildingSecondary().Content(
Contains("+more file1 content").Contains("+more file2 content"))

Expand Down

0 comments on commit 7f5465a

Please sign in to comment.