File tree Expand file tree Collapse file tree 2 files changed +26
-19
lines changed
pkg/integration/tests/filter_by_path Expand file tree Collapse file tree 2 files changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -15,26 +15,10 @@ var KeepSameCommitSelectedOnExit = NewIntegrationTest(NewIntegrationTestArgs{
15
15
commonSetup (shell )
16
16
},
17
17
Run : func (t * TestDriver , keys config.KeybindingConfig ) {
18
- t .Views ().Commits ().
19
- Focus ().
20
- Lines (
21
- Contains (`none of the two` ).IsSelected (),
22
- Contains (`both files` ),
23
- Contains (`only otherFile` ),
24
- Contains (`only filterFile` ),
25
- ).Press (keys .Universal .FilteringMenu ).
26
- Tap (func () {
27
- t .ExpectPopup ().Menu ().
28
- Title (Equals ("Filtering" )).
29
- Select (Contains ("Enter path to filter by" )).
30
- Confirm ()
18
+ filterByFilterFile (t , keys )
31
19
32
- t .ExpectPopup ().Prompt ().
33
- Title (Equals ("Enter path:" )).
34
- Type ("filterF" ).
35
- SuggestionLines (Equals ("filterFile" )).
36
- ConfirmFirstSuggestion ()
37
- }).
20
+ t .Views ().Commits ().
21
+ IsFocused ().
38
22
Lines (
39
23
Contains (`both files` ).IsSelected (),
40
24
Contains (`only filterFile` ),
Original file line number Diff line number Diff line change 1
1
package filter_by_path
2
2
3
3
import (
4
+ "github.com/jesseduffield/lazygit/pkg/config"
4
5
. "github.com/jesseduffield/lazygit/pkg/integration/components"
5
6
)
6
7
@@ -17,6 +18,28 @@ func commonSetup(shell *Shell) {
17
18
shell .EmptyCommit ("none of the two" )
18
19
}
19
20
21
+ func filterByFilterFile (t * TestDriver , keys config.KeybindingConfig ) {
22
+ t .Views ().Commits ().
23
+ Focus ().
24
+ Lines (
25
+ Contains (`none of the two` ).IsSelected (),
26
+ Contains (`both files` ),
27
+ Contains (`only otherFile` ),
28
+ Contains (`only filterFile` ),
29
+ ).
30
+ Press (keys .Universal .FilteringMenu )
31
+
32
+ t .ExpectPopup ().Menu ().
33
+ Title (Equals ("Filtering" )).
34
+ Select (Contains ("Enter path to filter by" )).
35
+ Confirm ()
36
+ t .ExpectPopup ().Prompt ().
37
+ Title (Equals ("Enter path:" )).
38
+ Type ("filterF" ).
39
+ SuggestionLines (Equals ("filterFile" )).
40
+ ConfirmFirstSuggestion ()
41
+ }
42
+
20
43
func postFilterTest (t * TestDriver ) {
21
44
t .Views ().Information ().Content (Contains ("Filtering by 'filterFile'" ))
22
45
You can’t perform that action at this time.
0 commit comments