From 7f5465a27bb52b9e17df35612bcaaf765de29a55 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 14 Apr 2023 20:50:13 +1000 Subject: [PATCH] fix flaky tests --- pkg/integration/tests/conflicts/undo_choose_hunk.go | 7 +++++++ .../patch_building/apply_in_reverse_with_conflict.go | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/integration/tests/conflicts/undo_choose_hunk.go b/pkg/integration/tests/conflicts/undo_choose_hunk.go index 0f2575304..b008ed762 100644 --- a/pkg/integration/tests/conflicts/undo_choose_hunk.go +++ b/pkg/integration/tests/conflicts/undo_choose_hunk.go @@ -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")). diff --git a/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go b/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go index 04d160a01..04373622c 100644 --- a/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go +++ b/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go @@ -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"))