mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +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:
parent
26c3e0d333
commit
c6df856079
1 changed files with 23 additions and 1 deletions
|
@ -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"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue