mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-08 22:36:49 +02:00
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:
@ -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"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user