From 595c7ee73e9d2053fc1cb4ca0b6fd1274852ee9a Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 11 May 2023 13:21:24 +0200 Subject: [PATCH] Extend one of the filtering tests to start on a commit other than the first Enabling the filter selects the first entry in the filtered commits view. It's useful to have a test that checks this, as I almost broke it in the following commit (it needs an added FocusLine call in the setFiltering function in filtering_menu_action.go). --- pkg/integration/tests/filter_by_path/select_file.go | 4 +++- pkg/integration/tests/filter_by_path/shared.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/integration/tests/filter_by_path/select_file.go b/pkg/integration/tests/filter_by_path/select_file.go index 6c1243dc8..80a69a2b4 100644 --- a/pkg/integration/tests/filter_by_path/select_file.go +++ b/pkg/integration/tests/filter_by_path/select_file.go @@ -18,10 +18,12 @@ var SelectFile = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Commits(). Focus(). Lines( - Contains(`only filterFile`).IsSelected(), + Contains(`none of the two`).IsSelected(), + Contains(`only filterFile`), Contains(`only otherFile`), Contains(`both files`), ). + SelectNextItem(). PressEnter() // when you click into the commit itself, you see all files from that commit diff --git a/pkg/integration/tests/filter_by_path/shared.go b/pkg/integration/tests/filter_by_path/shared.go index 93e5e0a3d..675a2d9df 100644 --- a/pkg/integration/tests/filter_by_path/shared.go +++ b/pkg/integration/tests/filter_by_path/shared.go @@ -14,6 +14,8 @@ func commonSetup(shell *Shell) { shell.UpdateFileAndAdd("filterFile", "new filterFile content") shell.Commit("only filterFile") + + shell.EmptyCommit("none of the two") } func postFilterTest(t *TestDriver) {