misc

package
v0.61.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfirmOnQuit = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Quitting with a confirm prompt",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig: func(config *config.AppConfig) {
		config.GetUserConfig().ConfirmOnQuit = true
	},
	SetupRepo: func(shell *Shell) {},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Files().
			IsFocused().
			Press(keys.Universal.Quit)

		t.ExpectPopup().Confirmation().
			Title(Equals("")).
			Content(Contains("Are you sure you want to quit?")).
			Confirm()
	},
})
View Source
var CopyConfirmationMessageToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Copy the text of a confirmation popup to the clipboard",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig: func(config *config.AppConfig) {
		config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
	},

	SetupRepo: func(shell *Shell) {
		shell.EmptyCommit("commit")
	},

	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Commits().
			Focus().
			Lines(
				Contains("commit").IsSelected(),
			).
			Press(keys.Universal.Remove)

		t.ExpectPopup().Alert().
			Title(Equals("Drop commit")).
			Content(Equals("Are you sure you want to drop the selected commit(s)?")).
			Tap(func() {
				t.GlobalPress(keys.Universal.CopyToClipboard)
				t.ExpectToast(Equals("Message copied to clipboard"))
			}).
			Confirm()

		t.FileSystem().FileContent("clipboard",
			Equals("Are you sure you want to drop the selected commit(s)?"))
	},
})
View Source
var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Copy a branch name to the clipboard using custom clipboard command template",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig: func(config *config.AppConfig) {
		config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
	},

	SetupRepo: func(shell *Shell) {
		shell.NewBranch("branch-a")
	},

	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Branches().
			Focus().
			Lines(
				Contains("branch-a").IsSelected(),
			).
			Press(keys.Universal.CopyToClipboard)

		t.ExpectToast(Equals("'branch-a' copied to clipboard"))

		t.FileSystem().FileContent("clipboard", Equals("branch-a"))
	},
})
View Source
var DisabledKeybindings = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Confirms you can disable keybindings by setting them to <disabled>",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig: func(config *config.AppConfig) {
		config.GetUserConfig().Keybinding.Universal.PrevItem = "<disabled>"
		config.GetUserConfig().Keybinding.Universal.NextItem = "<disabled>"
		config.GetUserConfig().Keybinding.Universal.NextTab = "<up>"
		config.GetUserConfig().Keybinding.Universal.PrevTab = "<down>"
	},
	SetupRepo: func(shell *Shell) {},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Files().
			IsFocused().
			Press("<up>")

		t.Views().Worktrees().IsFocused()
	},
})
View Source
var InitialOpen = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Confirms a popup appears on first opening Lazygit",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig: func(config *config.AppConfig) {
		config.GetUserConfig().DisableStartupPopups = false
	},
	SetupRepo: func(shell *Shell) {},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.ExpectPopup().Confirmation().
			Title(Equals("")).
			Content(Contains("Thanks for using lazygit!")).
			Confirm()

		t.Views().Files().IsFocused()
	},
})
View Source
var RecentReposOnLaunch = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "When 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()
	},
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL