ui

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Accordion = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Verify accordion mode kicks in when the screen height is too small",
	ExtraCmdArgs: []string{},
	Width:        100,
	Height:       10,
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		shell.CreateNCommits(20)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Commits().
			Focus().
			VisibleLines(
				Contains("commit 20").IsSelected(),
				Contains("commit 19"),
				Contains("commit 18"),
			).
			NavigateToLine(Contains("commit 11")).
			NavigateToLine(Contains("commit 10")).
			NavigateToLine(Contains("commit 11")).
			VisibleLines(
				Contains("commit 12"),
				Contains("commit 11").IsSelected(),
				Contains("commit 10"),
			)

		t.Views().Files().
			Focus()

		t.Views().Commits().
			Focus().
			VisibleLines(
				Contains("commit 12"),
				Contains("commit 11").IsSelected(),
				Contains("commit 10"),
			)
	},
})
View Source
var DoublePopup = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Open a popup from within another popup and assert you can escape back to the side panels",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		shell.EmptyCommit("one")
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Branches().
			Focus().
			PressPrimaryAction()

		t.ExpectPopup().Alert().
			Title(Contains("Error")).
			Content(Contains("You have already checked out this branch"))

		t.GlobalPress(keys.Universal.OpenRecentRepos)

		t.ExpectPopup().Menu().Title(Contains("Recent repositories")).Cancel()

		t.Views().Branches().IsFocused()

		t.Views().Files().Focus()
	},
})
View Source
var EmptyMenu = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Verify that we don't crash on an empty menu",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Files().
			IsFocused().
			Press(keys.Universal.OptionMenu)

		t.Views().Menu().
			IsFocused().
			FilterOrSearch("ljasldkjaslkdjalskdjalsdjaslkd").
			IsEmpty().
			Press(keys.Universal.Select)

		t.Views().Files().
			IsFocused()
	},
})
View Source
var SwitchTabFromMenu = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Switch tab via the options menu",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Files().IsFocused().
			Press(keys.Universal.OptionMenuAlt1)

		t.ExpectPopup().Menu().Title(Equals("Keybindings")).
			Select(Contains("Next tab")).
			Confirm()

		t.Views().Worktrees().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