summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/misc/recent_repos_on_launch.go
blob: dc0287261316381ea50ed31032e1b85279d59731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package misc

import (
	"github.com/jesseduffield/lazygit/pkg/config"
	. "github.com/jesseduffield/lazygit/pkg/integration/components"
)

// Couldn't find an easy way to actually reproduce the situation of opening outside a repo,
// so I'm introducing a hacky env var to force lazygit to show the recent repos meu upon opening.

var RecentReposOnLaunch = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "When opening opening to a menu, focus is correctly given to the menu",
	ExtraCmdArgs: []string{},
	ExtraEnvVars: map[string]string{
		"SHOW_RECENT_REPOS": "true",
	},
	Skip:        false,
	SetupConfig: func(config *config.AppConfig) {},
	SetupRepo:   func(shell *Shell) {},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.ExpectPopup().Menu().
			Title(Equals("Recent repositories")).
			Select(Contains("Cancel")).
			Confirm()

		t.Views().Files().IsFocused()
	},
})