summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/filter_and_search/filter_fuzzy.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/integration/tests/filter_and_search/filter_fuzzy.go')
-rw-r--r--pkg/integration/tests/filter_and_search/filter_fuzzy.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkg/integration/tests/filter_and_search/filter_fuzzy.go b/pkg/integration/tests/filter_and_search/filter_fuzzy.go
new file mode 100644
index 000000000..198020afa
--- /dev/null
+++ b/pkg/integration/tests/filter_and_search/filter_fuzzy.go
@@ -0,0 +1,35 @@
+package filter_and_search
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var FilterFuzzy = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Verify that fuzzy filtering works (not just exact matches)",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ shell.NewBranch("this-is-my-branch")
+ shell.EmptyCommit("first commit")
+ shell.NewBranch("other-branch")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Branches().
+ Focus().
+ Lines(
+ Contains(`other-branch`).IsSelected(),
+ Contains(`this-is-my-branch`),
+ ).
+ FilterOrSearch("timb"). // using first letters of words
+ Lines(
+ Contains(`this-is-my-branch`).IsSelected(),
+ ).
+ FilterOrSearch("brnch"). // allows missing letter
+ Lines(
+ Contains(`other-branch`).IsSelected(),
+ Contains(`this-is-my-branch`),
+ )
+ },
+})