summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/filter_by_author/shared.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/integration/tests/filter_by_author/shared.go')
-rw-r--r--pkg/integration/tests/filter_by_author/shared.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkg/integration/tests/filter_by_author/shared.go b/pkg/integration/tests/filter_by_author/shared.go
new file mode 100644
index 000000000..160bde1c0
--- /dev/null
+++ b/pkg/integration/tests/filter_by_author/shared.go
@@ -0,0 +1,30 @@
+package filter_by_author
+
+import (
+ "fmt"
+ "strings"
+
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+type AuthorInfo struct {
+ name string
+ numberOfCommits int
+}
+
+func commonSetup(shell *Shell) {
+ authors := []AuthorInfo{{"Yang Wen-li", 3}, {"Siegfried Kircheis", 1}, {"Paul Oberstein", 8}}
+ totalCommits := 0
+ repoStartDaysAgo := 100
+
+ for _, authorInfo := range authors {
+ for i := 0; i < authorInfo.numberOfCommits; i++ {
+ authorEmail := strings.ToLower(strings.ReplaceAll(authorInfo.name, " ", ".")) + "@email.com"
+ commitMessage := fmt.Sprintf("commit %d", i)
+
+ shell.SetAuthor(authorInfo.name, authorEmail)
+ shell.EmptyCommitDaysAgo(commitMessage, repoStartDaysAgo-totalCommits)
+ totalCommits++
+ }
+ }
+}