diff --git a/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go b/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go index 60ce9b580..950decc14 100644 --- a/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go +++ b/pkg/integration/tests/filter_and_search/filter_updates_when_model_changes.go @@ -41,13 +41,35 @@ var FilterUpdatesWhenModelChanges = NewIntegrationTest(NewIntegrationTestArgs{ }). Lines( Contains("checked-out-branch").IsSelected(), - ). + ) + + // Verify that updating the filter works even if the view is not the active one + t.Views().Files().Focus() + + // To do that, we use a custom command to create a new branch that matches the filter + t.GlobalPress(keys.Universal.ExecuteCustomCommand) + t.ExpectPopup().Prompt(). + Title(Equals("Custom command:")). + Type("git branch new-branch"). + Confirm() + + t.Views().Branches(). + Lines( + Contains("checked-out-branch").IsSelected(), + /* EXPECTED: + Contains("new-branch"), + */ + ) + + t.Views().Branches(). + Focus(). // cancel the filter PressEscape(). Lines( Contains("checked-out-branch").IsSelected(), Contains("other"), Contains("master"), + Contains("new-branch"), ) }, })