Add test demonstrating a problem with updating the filter when the model changes

We only update the filter when the filtered view has the focus.
This commit is contained in:
Stefan Haller 2024-06-10 11:19:54 +02:00
parent 26c3e0d333
commit c6df856079

View file

@ -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"),
)
},
})