Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Checkout = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Checkout a reflog commit as a detached head", ExtraCmdArgs: "", Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.EmptyCommit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). PressPrimaryAction(). Tap(func() { t.ExpectPopup().Confirmation(). Title(Contains("checkout commit")). Content(Contains("Are you sure you want to checkout this commit?")). Confirm() }). TopLines( Contains("checkout: moving from master to").IsSelected(), Contains("reset: moving to HEAD^^"), ) t.Views().Branches(). Lines( Contains("(HEAD detached at").IsSelected(), Contains("master"), ) t.Views().Commits(). Focus(). Lines( Contains("three").IsSelected(), Contains("two"), Contains("one"), ) }, })
View Source
var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Cherry pick a reflog commit", ExtraCmdArgs: "", Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.EmptyCommit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). Press(keys.Commits.CherryPickCopy) t.Views().Information().Content(Contains("1 commit copied")) t.Views().Commits(). Focus(). Lines( Contains("one").IsSelected(), ). Press(keys.Commits.PasteCommits). Tap(func() { t.ExpectPopup().Alert(). Title(Equals("Cherry-Pick")). Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")). Confirm() }). Lines( Contains("three").IsSelected(), Contains("one"), ) }, })
View Source
var Patch = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Build a patch from a reflog commit and apply it", ExtraCmdArgs: "", Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.CreateFileAndAdd("file1", "content1") shell.CreateFileAndAdd("file2", "content2") shell.Commit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). PressEnter() t.Views().SubCommits(). IsFocused(). Lines( Contains("three").IsSelected(), Contains("two"), Contains("one"), ). PressEnter() t.Views().CommitFiles(). IsFocused(). Lines( Contains("file1").IsSelected(), Contains("file2"), ). PressPrimaryAction() t.Views().Information().Content(Contains("building patch")) t.Views(). CommitFiles(). Press(keys.Universal.CreatePatchOptionsMenu) t.ExpectPopup().Menu(). Title(Equals("Patch Options")). Select(MatchesRegexp(`apply patch$`)).Confirm() t.Views().Files().Lines( Contains("file1"), ) }, })
View Source
var Reset = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Hard reset to a reflog commit", ExtraCmdArgs: "", Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.EmptyCommit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). Press(keys.Commits.ViewResetOptions). Tap(func() { t.ExpectPopup().Menu(). Title(Contains("reset to")). Select(Contains("hard reset")). Confirm() }). TopLines( Contains("reset: moving to").IsSelected(), Contains("reset: moving to HEAD^^"), ) t.Views().Commits(). Focus(). Lines( Contains("three").IsSelected(), Contains("two"), Contains("one"), ) }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.