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 BackgroundRefreshKeepsScrollPosition = NewIntegrationTest(NewIntegrationTestArgs{ Description: "A background refresh doesn't scroll the selection back into view", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") for i := range 20 { shell.CreateFile(fmt.Sprintf("file%02d", i), "") } }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). Focus(). SelectNextItem(). SelectedLine(Contains("file00")). ScrollWheelDown(). ScrollWheelDown(). OriginY(4). Tap(func() { t.Shell().CreateFile("aaa", "") t.RefreshInBackground() }). SelectedLineIdx(2). OriginY(4) }, })
View Source
var BranchesNotFirstTab = NewIntegrationTest(NewIntegrationTestArgs{ Description: "With gui.sidePanels grouping branches behind another tab, no ghost view must appear over the side panels", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Gui.SidePanels = []config.SidePanel{ {"worktrees", "branches", "remotes"}, {"files"}, {"commits", "tags"}, {"stash"}, } }, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().RemoteBranches(). IsInvisible() t.Views().SubCommits().IsInvisible() }, })
View Source
var CommitsNotFirstTab = NewIntegrationTest(NewIntegrationTestArgs{ Description: "With gui.sidePanels grouping commits behind another tab, no ghost view must appear over the side panels", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Gui.SidePanels = []config.SidePanel{ {"branches", "worktrees", "remotes"}, {"files"}, {"tags", "commits"}, {"stash"}, } }, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().CommitFiles(). IsInvisible() }, })
View Source
var DisableSwitchTabWithPanelJumpKeys = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Verify that the tab does not change by default when jumping to an already focused panel", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { }, SetupRepo: func(shell *Shell) { }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Status().Focus(). Press(keys.Universal.JumpToBlock[1]) t.Views().Files().IsFocused(). Press(keys.Universal.JumpToBlock[1]) t.Views().Files().IsFocused() }, })
View Source
var DragBeyondViewport = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Dragging a range selection beyond the bottom of the panel doesn't scroll the view", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") for i := range 20 { shell.CreateFile(fmt.Sprintf("file%02d", i), "") } }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). Focus(). OriginY(0). ClickAndHold(1, 1). MouseMove(1, 8). MouseRelease(). SelectedLineIdx(8). OriginY(0) }, })
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.ExpectPopup().Menu(). Filter("ljasldkjaslkdjalskdjalsdjaslkd") t.Views().Menu(). IsFocused(). IsEmpty(). Press(keys.Universal.ConfirmMenu). Tap(func() { t.ExpectToast(Equals("Disabled: No item selected")) }). PressEscape(). PressEscape() t.Views().Files(). IsFocused() }, })
View Source
var FilteringScrollsSelectionIntoView = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Entering and leaving filtering mode scrolls the selected commit into view", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { for i := range 40 { file := "otherFile" if i%2 == 0 { file = "filterFile" } shell.UpdateFileAndAdd(file, fmt.Sprintf("content %02d", i)) shell.Commit(fmt.Sprintf("commit %02d", i)) } }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). Press(keys.Universal.GotoBottom). SelectedLine(Contains("commit 00")). OriginYAtLeast(1). Press(keys.Universal.FilteringMenu) t.ExpectPopup().Menu(). Title(Equals("Filtering")). Select(Contains("Enter path to filter by")). Confirm() t.ExpectPopup().Prompt(). Title(Equals("Enter path:")). Type("filterFile"). Confirm() t.Views().Commits(). IsFocused(). SelectedLine(Contains("commit 38")). SelectedLineIdx(0). OriginY(0). Press(keys.Universal.GotoBottom). SelectedLine(Contains("commit 00")). PressEscape() t.Views().Commits(). IsFocused(). SelectedLine(Contains("commit 00")). SelectedLineIsVisible() }, })
View Source
var FindBaseCommitForFixupScrollsIntoView = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Finding the base commit for a fixup scrolls it into view", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.NewBranch("mybranch"). EmptyCommit("1st commit"). CreateFileAndAdd("file1", "line 1\nline 2\nline 3\n"). Commit("base commit"). CreateNCommits(40). UpdateFile("file1", "line 1\nline 2 changed\nline 3\n") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). Focus(). Press(keys.Files.FindBaseCommitForFixup) t.Views().Commits(). IsFocused(). SelectedLine(Contains("base commit")). SelectedLineIsVisible() }, })
View Source
var HideSidePanel = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Hide a side panel by omitting it from gui.sidePanels", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Gui.SidePanels = []config.SidePanel{ {"status"}, {"files", "worktrees", "submodules"}, {"branches", "remotes", "tags"}, {"commits", "reflog"}, } }, SetupRepo: func(shell *Shell) { shell.CreateNCommits(2) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files().IsFocused(). Press(keys.Universal.JumpToBlock[3]) t.Views().Commits().IsFocused(). Press(keys.Universal.NextBlock) t.Views().Status().IsFocused() }, })
View Source
var KeybindingSuggestionsDontCrashOnDisabledBindings = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Filter out keybinding suggestions whose bindings are disabled", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { config.GetUserConfig().Keybinding.Files.StashAllChanges = []string{} }, SetupRepo: func(shell *Shell) {}, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files().Focus() t.Views().Options().Content( Equals("Commit: c | Reset: D | Keybindings: ?")) }, })
View Source
var KeybindingSuggestionsWhenSwitchingRepos = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Show correct keybinding suggestions after switching between repos", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { otherRepo, _ := filepath.Abs("../other") config.GetAppState().RecentRepos = []string{otherRepo} }, SetupRepo: func(shell *Shell) { shell.CloneNonBare("other") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { switchToRepo := func(repo string) { t.GlobalPress(keys.Universal.OpenRecentRepos) t.ExpectPopup().Menu().Title(Equals("Recent repositories")). Lines( Contains(repo).IsSelected(), Contains("Cancel"), ).Confirm() t.Views().Status().Content(Contains(repo + " → master")) } t.Views().Files().Focus() t.Views().Options().Content( Equals("Commit: c | Stash: s | Reset: D | Keybindings: ?")) switchToRepo("other") switchToRepo("repo") t.Views().Options().Content( Equals("Commit: c | Stash: s | Reset: D | Keybindings: ?")) }, })
View Source
var MenuScrollPositionIsReset = NewIntegrationTest(NewIntegrationTestArgs{ Description: "A menu that is opened after a scrolled down one starts at the top again", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateFile("myfile", "myfile") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). IsFocused(). Press(keys.Universal.OptionMenu) t.Views().Menu(). IsFocused(). SelectedLineIdx(1). OriginY(0). Press(keys.Universal.GotoBottom). OriginYAtLeast(1). PressEscape() t.Views().Files(). IsFocused(). Press(keys.Universal.OptionMenu) t.Views().Menu(). IsFocused(). SelectedLineIdx(1). OriginY(0) }, })
View Source
var ModeSpecificKeybindingSuggestions = NewIntegrationTest(NewIntegrationTestArgs{ Description: "When in various modes, we should corresponding keybinding suggestions onscreen", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateNCommits(2) shell.NewBranch("base-branch") shared.MergeConflictsSetup(shell) shell.Checkout("base-branch") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { rebaseSuggestion := "View rebase options: m" cherryPickSuggestion := "Paste (cherry-pick): V" bisectSuggestion := "View bisect options: b" customPatchSuggestion := "View custom patch options: <ctrl+p>" mergeSuggestion := "View merge options: m" t.Views().Commits(). Focus(). Lines( Contains("commit-02").IsSelected(), Contains("commit-01"), ). Tap(func() { t.Views().Options().Content( DoesNotContain(rebaseSuggestion). DoesNotContain(mergeSuggestion). DoesNotContain(cherryPickSuggestion). DoesNotContain(bisectSuggestion). DoesNotContain(customPatchSuggestion), ) }). Press(keys.Universal.Edit). Tap(func() { t.Views().Options().Content(Contains(rebaseSuggestion)) }). Press(keys.Commits.CherryPickCopy). Tap(func() { t.Views().Options().Content(Contains(cherryPickSuggestion)) t.Views().Options().Content(Contains(rebaseSuggestion)) }). PressEscape(). Tap(func() { t.Views().Options().Content(DoesNotContain(cherryPickSuggestion)) }). Tap(func() { t.Common().AbortRebase() t.Views().Options().Content(DoesNotContain(rebaseSuggestion)) }). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu(). Title(Equals("Bisect")). Select(MatchesRegexp("Mark.* as bad")). Confirm() t.Views().Options().Content(Contains(bisectSuggestion)) t.Common().ResetBisect() t.Views().Options().Content(DoesNotContain(bisectSuggestion)) }). PressEnter() t.Views().CommitFiles(). IsFocused(). Press(keys.Universal.Select). Tap(func() { t.Views().Options().Content(Contains(customPatchSuggestion)) t.Common().ResetCustomPatch() t.Views().Options().Content(DoesNotContain(customPatchSuggestion)) }) t.Views().Branches(). Focus(). NavigateToLine(Contains("first-change-branch")). Press(keys.Universal.Select). NavigateToLine(Contains("second-change-branch")). Press(keys.Branches.MergeIntoCurrentBranch). Tap(func() { t.ExpectPopup().Menu(). Title(Equals("Merge")). Select(Contains("Regular merge (with merge commit)")). Confirm() t.Common().AcknowledgeConflicts() t.Views().Options().Content(Contains(mergeSuggestion)) t.Common().AbortMerge() t.Views().Options().Content(DoesNotContain(mergeSuggestion)) }) }, })
View Source
var MoveCommitScrollsSelectionIntoView = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Moving a commit down scrolls it into view if it isn't visible", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateNCommits(40) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). SelectedLine(Contains("commit-40")). ScrollWheelDown(). ScrollWheelDown(). OriginY(4). Press(keys.Commits.MoveDownCommit). SelectedLine(Contains("commit-40")). SelectedLineIdx(1). SelectedLineIsVisible() }, })
View Source
var OpenLinkFailure = NewIntegrationTest(NewIntegrationTestArgs{ Description: "When opening links via the OS fails, show a dialog instead.", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { config.GetUserConfig().OS.OpenLink = "exit 42" }, SetupRepo: func(shell *Shell) {}, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Information().Click(0, 0) t.ExpectPopup().Confirmation(). Title(Equals("Error")). Content(Equals("Failed to open URL https://github.com/sponsors/jesseduffield\n\nError: exit status 42")). Confirm() }, })
View Source
var PageUpAndDown = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Paging down and up keeps the selection at the edge of the viewport", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateNCommits(40) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). SelectedLineIdx(0). OriginY(0). Press(keys.Universal.NextPage). SelectedLineIdx(commitsPanelHeight - 1). OriginY(0). Press(keys.Universal.NextPage). SelectedLineIdx(commitsPanelHeight - 1 + pageDelta). OriginY(pageDelta). Press(keys.Universal.PrevPage). SelectedLineIdx(pageDelta). OriginY(pageDelta). Press(keys.Universal.PrevPage). SelectedLineIdx(0). OriginY(0) }, })
View Source
var PromoteTabToSidePanel = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Promote the worktrees tab to its own top-level side panel via gui.sidePanels", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Gui.SidePanels = []config.SidePanel{ {"status"}, {"files", "submodules"}, {"worktrees"}, {"branches", "remotes", "tags"}, {"commits", "reflog"}, {"stash"}, } }, SetupRepo: func(shell *Shell) { shell.CreateNCommits(2) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files().IsFocused(). Press(keys.Universal.JumpToBlock[2]) t.Views().Worktrees().IsFocused(). Press(keys.Universal.JumpToBlock[1]) t.Views().Files().IsFocused(). Press(keys.Universal.NextTab) t.Views().Submodules().IsFocused() }, })
View Source
var RangeSelect = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Verify range select works as expected in list views and in patch explorer views", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { config.GetUserConfig().Gui.UseHunkModeInStagingView = false config.GetUserConfig().Gui.ExpandFocusedSidePanel = true }, SetupRepo: func(shell *Shell) { fileContent := "staged\n" total := 10 for i := 1; i <= total; i++ { remaining := total - i + 1 shell.EmptyCommit(fmt.Sprintf("line %d", remaining)) fileContent = fmt.Sprintf("%sline %d\n", fileContent, i) } shell.CreateFileAndAdd("file1", "staged\n") shell.UpdateFile("file1", fileContent) shell.NewBranch("branch1").NewBranch("branch2") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { assertRangeSelectBehaviour := func(v *ViewDriver, focusOtherView func(), lineIdxOfFirstItem int) { v. SelectedLines( Contains("line 1"), ). Press(keys.Universal.ToggleRangeSelect). SelectedLines( Contains("line 1"), ). SelectNextItem(). SelectedLines( Contains("line 1"), Contains("line 2"), ). Press(keys.Universal.ToggleRangeSelect). SelectedLines( Contains("line 2"), ). SelectPreviousItem(). SelectedLines( Contains("line 1"), ). Press(keys.Universal.RangeSelectDown). SelectedLines( Contains("line 1"), Contains("line 2"), ). Press(keys.Universal.RangeSelectDown). SelectedLines( Contains("line 1"), Contains("line 2"), Contains("line 3"), ). Press(keys.Universal.RangeSelectUp). SelectedLines( Contains("line 1"), Contains("line 2"), ). SelectNextItem(). SelectedLines( Contains("line 3"), ). Press(keys.Universal.ToggleRangeSelect). SelectedLines( Contains("line 3"), ). SelectNextItem(). SelectedLines( Contains("line 3"), Contains("line 4"), ). Press(keys.Universal.RangeSelectDown). SelectedLines( Contains("line 3"), Contains("line 4"), Contains("line 5"), ). SelectNextItem(). SelectedLines( Contains("line 6"), ). Press(keys.Universal.RangeSelectDown). SelectedLines( Contains("line 6"), Contains("line 7"), ). Press(keys.Universal.ToggleRangeSelect). SelectedLines( Contains("line 7"), ). Press(keys.Universal.RangeSelectDown). SelectedLines( Contains("line 7"), Contains("line 8"), ). PressEscape(). SelectedLines( Contains("line 8"), ). Press(keys.Universal.ToggleRangeSelect). Press(keys.Universal.GotoBottom). SelectedLines( Contains("line 8"), Contains("line 9"), Contains("line 10"), ). PressEscape(). SelectedLines( Contains("line 10"), ) focusOtherView() v.Click(1, lineIdxOfFirstItem). SelectedLines( Contains("line 1"), ). Press(keys.Universal.RangeSelectDown). SelectedLines( Contains("line 1"), Contains("line 2"), ) } assertRangeSelectBehaviour(t.Views().Commits().Focus(), func() { t.Views().Branches().Focus() }, 0) t.Views().Files(). Focus(). SelectedLine( Contains("file1"), ). PressEnter() assertRangeSelectBehaviour(t.Views().Staging().IsFocused(), func() { t.Views().Staging().PressTab() }, 6) t.Views().Branches().Focus() t.Views().Branches(). SelectedLines( Contains("branch2"), ) t.Views().Commits(). ClickAndHold(1, 3). MouseMoveToView(t.Views().Branches(), 1, 2). SelectedLines( Contains("line 1"), Contains("line 2"), Contains("line 3"), Contains("line 4"), ). Tap(func() { t.Views().Branches().SelectedLines( Contains("branch2"), ) }). MouseRelease() t.Views().Branches().Focus() t.Views().Commits(). ClickAndHold(1, 0). SelectedLines( Contains("line 1"), ). RepeatMouseMove(). SelectedLines( Contains("line 1"), ). MouseMove(1, 3). SelectedLines( Contains("line 1"), Contains("line 2"), Contains("line 3"), Contains("line 4"), ). MouseRelease(). Click(1, 0) }, })
View Source
var RangeSelectWithAutoscroll = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Keep scrolling while creating a range selection at the panel edge", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) { config.GetUserConfig().Gui.UseHunkModeInStagingView = false }, SetupRepo: func(shell *Shell) { shell.CreateNCommits(40) fileContent := "base\n" shell.CreateFileAndAdd("file1", fileContent) for i := 1; i <= 40; i++ { fileContent += fmt.Sprintf("line %d\n", i) } shell.UpdateFile("file1", fileContent) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Branches().Focus() t.Views().Commits(). ClickAndHold(1, 0). MouseMoveToBottom(1). OriginYAtLeast(3). SelectedLineIdxAtLeast(3). MouseRelease() t.Views().Files(). Focus(). PressEnter() t.Views().Staging(). ClickAndHold(1, 6). MouseMoveToBottom(1). OriginYAtLeast(3). SelectedLineIdxAtLeast(9). MouseRelease() }, })
View Source
var ReloadSidePanels = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Editing the side panel config and refocusing the window re-applies the layout live, keeping the focused panel focused", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateNCommits(2) shell.CreateFile(".git/lazygit.yml", ` gui: sidePanels: - [status] - [files, submodules] - [worktrees] - [branches, remotes, tags] - [commits, reflog] - [stash]`) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files().IsFocused(). Press(keys.Universal.JumpToBlock[2]) t.Views().Worktrees().IsFocused() t.Shell().UpdateFile(".git/lazygit.yml", ` gui: sidePanels: - [status] - [files, worktrees, submodules] - [branches, remotes, tags] - [commits, reflog] - [stash]`) t.FocusIn() t.Views().Worktrees().IsActiveTab().IsFocused(). Press(keys.Universal.PrevTab) t.Views().Files().IsActiveTab().IsFocused() }, })
View Source
var ReorderSidePanels = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Reorder the side panels with gui.sidePanels, swapping the branches and commits panels", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Gui.SidePanels = []config.SidePanel{ {"status"}, {"files", "worktrees", "submodules"}, {"commits", "reflog"}, {"branches", "remotes", "tags"}, {"stash"}, } }, SetupRepo: func(shell *Shell) { shell.CreateNCommits(2) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files().IsFocused(). Press(keys.Universal.JumpToBlock[2]) t.Views().Commits().IsFocused(). Press(keys.Universal.JumpToBlock[3]) t.Views().Branches().IsFocused() }, })
View Source
var SubCommitsScrollPositionIsReset = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Viewing the commits of a branch again after scrolling down starts at the top again", ExtraCmdArgs: []string{}, Skip: false, Width: 120, Height: 30, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateNCommits(40) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Branches(). Focus(). PressEnter() t.Views().SubCommits(). IsFocused(). OriginY(0). Press(keys.Universal.GotoBottom). OriginYAtLeast(1). PressEscape() t.Views().Branches(). IsFocused(). PressEnter() t.Views().SubCommits(). IsFocused(). SelectedLineIdx(0). OriginY(0) }, })
View Source
var SuggestionsSelectionFollowsTheFocus = NewIntegrationTest(NewIntegrationTestArgs{ Description: "The suggestions list only shows a selection while it, rather than the prompt, has the focus", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell. EmptyCommit("one"). NewBranch("branch-to-checkout") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Branches(). Focus(). Press(keys.Branches.CheckoutBranchByName) t.ExpectPopup().Prompt(). Title(Equals("Branch name:")). Type("branch-to"). SuggestionTopLines(Contains("branch-to-checkout")) t.Views().Suggestions().SelectionIsHidden() t.Views().Prompt().Press(keys.Universal.TogglePanel) t.Views().Suggestions(). IsFocused(). SelectionIsActive(). Press(keys.Universal.TogglePanel) t.Views().Prompt().IsFocused() t.Views().Suggestions().SelectionIsHidden() t.Views().Prompt().Press(keys.Universal.Return) t.Views().Branches().IsFocused() }, })
View Source
var SwitchRepoMovesTheSelection = NewIntegrationTest(NewIntegrationTestArgs{ Description: "The selection follows the focus of the repo being switched to, rather than the one being left", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { otherRepo, _ := filepath.Abs("../other") config.GetAppState().RecentRepos = []string{otherRepo} }, SetupRepo: func(shell *Shell) { shell.CloneNonBare("other") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { switchToRepo := func(repo string) { t.GlobalPress(keys.Universal.OpenRecentRepos) t.ExpectPopup().Menu().Title(Equals("Recent repositories")). Lines( Contains(repo).IsSelected(), Contains("Cancel"), ).Confirm() t.Views().Status().Content(Contains(repo + " → master")) } t.Views().Branches(). Focus(). SelectionIsActive() switchToRepo("other") t.Views().Files().IsFocused() t.Views().Branches().SelectionIsHidden() switchToRepo("repo") t.Views().Branches(). IsFocused(). SelectionIsActive() t.Views().Files().SelectionIsHidden() }, })
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.OptionMenu) t.ExpectPopup().Menu().Title(Equals("Keybindings")). Select(Contains("Next tab")). Confirm() t.Views().Worktrees().IsFocused() }, })
View Source
var SwitchTabWithPanelJumpKeys = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Switch tab with the panel jump keys after enabling the feature", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { config.GetUserConfig().Gui.SwitchTabsWithPanelJumpKeys = true }, SetupRepo: func(shell *Shell) { }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Worktrees().Focus(). Press(keys.Universal.JumpToBlock[2]) t.Views().Branches().IsFocused(). Press(keys.Universal.JumpToBlock[2]) t.Views().Remotes().IsFocused(). Press(keys.Universal.JumpToBlock[2]) t.Views().Tags().IsFocused(). Press(keys.Universal.JumpToBlock[2]) t.Views().Branches().IsFocused(). Press(keys.Universal.JumpToBlock[1]) t.Views().Worktrees().IsFocused() }, })
View Source
var ToggleWhitespaceKeepsUnfocusedSelectionDimmed = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Toggling whitespace from the main view leaves the panel beneath it showing a dimmed selection", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateFileAndAdd("file1", "one\n") shell.Commit("one") shell.UpdateFile("file1", " one\n") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). IsFocused(). Lines(Contains("file1")). Press(keys.Universal.FocusMainView) t.Views().Main(). IsFocused(). Press(keys.Universal.ToggleWhitespaceInDiffView) t.Views().Files(). SelectionIsInactive() }, })
View Source
var UnfocusedListHidesSelectionWhenEmptied = NewIntegrationTest(NewIntegrationTestArgs{ Description: "A list that loses its last item while the focus is elsewhere stops showing a selection", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateFileAndAdd("file1", "one\n") shell.Commit("one") shell.UpdateFile("file1", "two\n") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). IsFocused(). Lines(Contains("file1")). SelectionIsActive(). Press(keys.Universal.FocusMainView) t.Views().Main().IsFocused() t.Views().Files(). SelectionIsInactive(). Tap(func() { t.Shell().RunCommand([]string{"git", "checkout", "--", "file1"}) t.RefreshInBackground() }). IsEmpty(). SelectionIsHidden() }, })
View Source
var UnfocusedListShowsSelectionWhenFilled = NewIntegrationTest(NewIntegrationTestArgs{ Description: "A list that gets its first item while the focus is elsewhere starts showing a selection", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.CreateFileAndAdd("file1", "one\n") shell.Commit("one") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). IsFocused(). IsEmpty(). SelectionIsHidden(). Press(keys.Universal.FocusMainView) t.Views().Main().IsFocused() t.Views().Files(). Tap(func() { t.Shell().CreateFile("file2", "two\n") t.RefreshInBackground() }). Lines(Contains("file2")). SelectionIsInactive() }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Source Files
¶
- accordion.go
- background_refresh_keeps_scroll_position.go
- branches_not_first_tab.go
- commits_not_first_tab.go
- disable_switch_tab_with_panel_jump_keys.go
- drag_beyond_viewport.go
- empty_menu.go
- filtering_scrolls_selection_into_view.go
- find_base_commit_for_fixup_scrolls_into_view.go
- hide_side_panel.go
- keybinding_suggestions_dont_crash_on_disabled_bindings.go
- keybinding_suggestions_when_switching_repos.go
- menu_scroll_position_is_reset.go
- mode_specific_keybinding_suggestions.go
- move_commit_scrolls_selection_into_view.go
- open_link_failure.go
- page_up_and_down.go
- promote_tab_to_side_panel.go
- range_select.go
- range_select_with_autoscroll.go
- reload_side_panels.go
- reorder_side_panels.go
- sub_commits_scroll_position_is_reset.go
- suggestions_selection_follows_the_focus.go
- switch_repo_moves_the_selection.go
- switch_tab_from_menu.go
- switch_tab_with_panel_jump_keys.go
- toggle_whitespace_keeps_unfocused_selection_dimmed.go
- unfocused_list_hides_selection_when_emptied.go
- unfocused_list_shows_selection_when_filled.go
Click to show internal directories.
Click to hide internal directories.