Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Checkout = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Checkout a tag", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.CreateLightweightTag("tag", "HEAD^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). Lines( Contains("tag").IsSelected(), ). PressPrimaryAction() t.Views().Branches().IsFocused().Lines( Contains("HEAD detached at tag").IsSelected(), Contains("master"), ) }, })
View Source
var CheckoutWhenBranchWithSameNameExists = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Checkout a tag when there's a branch with the same name", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.NewBranch("tag") shell.Checkout("master") shell.EmptyCommit("two") shell.CreateLightweightTag("tag", "HEAD") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). Lines( Contains("tag").IsSelected(), ). PressPrimaryAction() t.Views().Branches().IsFocused().Lines( Contains("HEAD detached at tag").IsSelected(), Contains("master"), Contains("tag"), ) }, })
View Source
var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Copy the tag 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("one") shell.CreateLightweightTag("super.l000ongtag", "HEAD") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). Lines( Contains("tag").IsSelected(), ). Press(keys.Universal.CopyToClipboard) t.ExpectToast(Equals("'super.l000ongtag' copied to clipboard")) t.FileSystem().FileContent("clipboard", Equals("super.l000ongtag")) }, })
View Source
var CreateWhileCommitting = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Draft a commit message, escape out, and make a tag. Verify the draft message doesn't appear in the tag create prompt", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") shell.CreateFileAndAdd("file.txt", "file contents") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Files(). Press(keys.Files.CommitChanges). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Commit summary")). Type("draft message"). Cancel() }) t.Views().Tags(). Focus(). IsEmpty(). Press(keys.Universal.New). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Tag name")). InitialText(Equals("")) }) }, })
View Source
var CrudAnnotated = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Create and delete an annotated tag in the tags panel", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") shell.CloneIntoRemote("origin") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). IsEmpty(). Press(keys.Universal.New). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Tag name")). Type("new-tag"). SwitchToDescription(). Title(Equals("Tag description")). Type("message"). SwitchToSummary(). Confirm() }). Lines( MatchesRegexp(`new-tag.*message`).IsSelected(), ). Tap(func() { t.Views().Main().ContainsLines( Equals("Annotated tag: new-tag"), Equals(""), Contains("Tagger:"), Contains("TaggerDate:"), Equals(""), Equals("message"), Equals(""), Equals("---"), ) }). Press(keys.Universal.Push). Tap(func() { t.ExpectPopup().Prompt(). Title(Equals("Remote to push tag 'new-tag' to:")). InitialText(Equals("origin")). SuggestionLines( Contains("origin"), ). Confirm() }). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete tag 'new-tag'?")). Select(Contains("Delete remote tag")). Confirm() }). Tap(func() { t.ExpectPopup().Prompt(). Title(Equals("Remote from which to remove tag 'new-tag':")). InitialText(Equals("origin")). SuggestionLines( Contains("origin"), ). Confirm() }). Tap(func() { t.ExpectPopup(). Confirmation(). Title(Equals("Delete tag 'new-tag'?")). Content(Equals("Are you sure you want to delete the remote tag 'new-tag' from 'origin'?")). Confirm() t.ExpectToast(Equals("Remote tag deleted")) }). Lines( MatchesRegexp(`new-tag.*message`).IsSelected(), ). Tap(func() { t.Git(). RemoteTagDeleted("origin", "new-tag") }). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete tag 'new-tag'?")). Select(Contains("Delete local tag")). Confirm() }). IsEmpty(). Press(keys.Universal.New). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Tag name")). InitialText(Equals("")) }) }, })
View Source
var CrudLightweight = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Create and delete a lightweight tag in the tags panel", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") shell.CloneIntoRemote("origin") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). IsEmpty(). Press(keys.Universal.New). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Tag name")). Type("new-tag"). Confirm() }). Lines( MatchesRegexp(`new-tag.*initial commit`).IsSelected(), ). Tap(func() { t.Views().Main().ContainsLines( Equals("Lightweight tag: new-tag"), Equals(""), Equals("---"), ) }). PressEnter(). Tap(func() { t.Views().SubCommits().IsFocused(). Lines( Contains("initial commit"), ). PressEscape() }). Press(keys.Universal.Push). Tap(func() { t.ExpectPopup().Prompt(). Title(Equals("Remote to push tag 'new-tag' to:")). InitialText(Equals("origin")). SuggestionLines( Contains("origin"), ). Confirm() }). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete tag 'new-tag'?")). Select(Contains("Delete remote tag")). Confirm() }). Tap(func() { t.ExpectPopup().Prompt(). Title(Equals("Remote from which to remove tag 'new-tag':")). InitialText(Equals("origin")). SuggestionLines( Contains("origin"), ). Confirm() }). Tap(func() { t.ExpectPopup(). Confirmation(). Title(Equals("Delete tag 'new-tag'?")). Content(Equals("Are you sure you want to delete the remote tag 'new-tag' from 'origin'?")). Confirm() t.ExpectToast(Equals("Remote tag deleted")) }). Lines( MatchesRegexp(`new-tag.*initial commit`).IsSelected(), ). Tap(func() { t.Git(). RemoteTagDeleted("origin", "new-tag") }). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete tag 'new-tag'?")). Select(Contains("Delete local tag")). Confirm() }). IsEmpty() }, })
View Source
var DeleteLocalAndRemote = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Create and delete both local and remote annotated tag", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") shell.CloneIntoRemote("origin") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). IsEmpty(). Press(keys.Universal.New). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Tag name")). Type("new-tag"). SwitchToDescription(). Title(Equals("Tag description")). Type("message"). SwitchToSummary(). Confirm() }). Lines( MatchesRegexp(`new-tag.*message`).IsSelected(), ). Press(keys.Universal.Push). Tap(func() { t.ExpectPopup().Prompt(). Title(Equals("Remote to push tag 'new-tag' to:")). InitialText(Equals("origin")). SuggestionLines( Contains("origin"), ). Confirm() }). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete tag 'new-tag'?")). Select(Contains("Delete local and remote tag")). Confirm() }). Tap(func() { t.ExpectPopup().Prompt(). Title(Equals("Remote from which to remove tag 'new-tag':")). InitialText(Equals("origin")). SuggestionLines( Contains("origin"), ). Confirm() }). Tap(func() { t.ExpectPopup(). Confirmation(). Title(Equals("Delete tag 'new-tag'?")). Content(Equals("Are you sure you want to delete 'new-tag' from both your machine and from 'origin'?")). Confirm() }). IsEmpty(). Tap(func() { t.Shell().AssertRemoteTagNotFound("origin", "new-tag") }) }, })
View Source
var DeleteMultiple = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Delete a range selection of tags remotely, locally and remotely, and locally", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") shell.CloneIntoRemote("origin") for i := 1; i <= 8; i++ { shell.EmptyCommitWithDate(fmt.Sprintf("commit %02d", i), fmt.Sprintf("2024-01-%02d 10:00:00", i)) shell.CreateLightweightTag(fmt.Sprintf("tag-%02d", i), "HEAD") } for _, tag := range []string{"tag-03", "tag-04", "tag-05", "tag-06"} { shell.PushBranch("origin", "refs/tags/"+tag) } }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). Lines( Contains("tag-08").IsSelected(), Contains("tag-07"), Contains("tag-06"), Contains("tag-05"), Contains("tag-04"), Contains("tag-03"), Contains("tag-02"), Contains("tag-01"), ). NavigateToLine(Contains("tag-06")). Press(keys.Universal.RangeSelectDown). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete selected tags?")). Select(Contains("Delete remote tags")). Confirm() t.ExpectPopup().Prompt(). Title(Equals("Remote from which to remove the selected tags:")). InitialText(Equals("origin")). Confirm() t.ExpectPopup(). Confirmation(). Title(Equals("Delete selected tags?")). Content(Equals("Are you sure you want to delete the selected tags from 'origin'?")). Confirm() t.ExpectToast(Equals("Remote tags deleted")) }). Lines( Contains("tag-08"), Contains("tag-07"), Contains("tag-06").IsSelected(), Contains("tag-05").IsSelected(), Contains("tag-04"), Contains("tag-03"), Contains("tag-02"), Contains("tag-01"), ). Tap(func() { t.Git(). RemoteTagDeleted("origin", "tag-06"). RemoteTagDeleted("origin", "tag-05") }). NavigateToLine(Contains("tag-04")). Press(keys.Universal.RangeSelectDown). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete selected tags?")). Select(Contains("Delete local and remote tags")). Confirm() t.ExpectPopup().Prompt(). Title(Equals("Remote from which to remove the selected tags:")). InitialText(Equals("origin")). Confirm() t.ExpectPopup(). Confirmation(). Title(Equals("Delete selected tags?")). Content(Equals("Are you sure you want to delete the selected tags from both your machine and from 'origin'?")). Confirm() }). Lines( Contains("tag-08"), Contains("tag-07"), Contains("tag-06"), Contains("tag-05"), Contains("tag-02").IsSelected(), Contains("tag-01"), ). Tap(func() { t.Git(). RemoteTagDeleted("origin", "tag-04"). RemoteTagDeleted("origin", "tag-03") }). NavigateToLine(Contains("tag-07")). Press(keys.Universal.RangeSelectDown). Press(keys.Universal.Remove). Tap(func() { t.ExpectPopup(). Menu(). Title(Equals("Delete selected tags?")). Select(Contains("Delete local tags")). Confirm() }). Lines( Contains("tag-08"), Contains("tag-05").IsSelected(), Contains("tag-02"), Contains("tag-01"), ) }, })
View Source
var DeleteRemoteTagWhenBranchWithSameNameExists = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Delete a remote tag when a remote branch with the same name exists", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") shell.CloneIntoRemote("origin") shell.CreateLightweightTag("xyz", "HEAD") shell.PushBranch("origin", "HEAD:refs/tags/xyz") shell.PushBranch("origin", "HEAD:refs/heads/xyz") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). Lines( Contains("xyz").IsSelected(), ). Press(keys.Universal.Remove) t.ExpectPopup(). Menu(). Title(Equals("Delete tag 'xyz'?")). Select(Contains("Delete remote tag")). Confirm() t.ExpectPopup().Prompt(). Title(Equals("Remote from which to remove tag 'xyz':")). InitialText(Equals("origin")). SuggestionLines( Contains("origin"), ). Confirm() t.ExpectPopup(). Confirmation(). Title(Equals("Delete tag 'xyz'?")). Content(Equals("Are you sure you want to delete the remote tag 'xyz' from 'origin'?")). Confirm() t.ExpectToast(Equals("Remote tag deleted")) t.Shell().AssertRemoteTagNotFound("origin", "xyz") }, })
View Source
var ForceTagAnnotated = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Overwrite an annotated tag that already exists", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("first commit") shell.CreateAnnotatedTag("new-tag", "message", "HEAD") shell.EmptyCommit("second commit") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). Lines( Contains("second commit").IsSelected(), Contains("new-tag").Contains("first commit"), ). Press(keys.Commits.CreateTag). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Tag name")). Type("new-tag"). SwitchToDescription(). Title(Equals("Tag description")). Type("message"). SwitchToSummary(). Confirm() }). Tap(func() { t.ExpectPopup().Confirmation(). Title(Equals("Force Tag")). Content(Contains("The tag 'new-tag' exists already. Press <esc> to cancel, or <enter> to overwrite.")). Confirm() }). Lines( Contains("new-tag").Contains("second commit"), DoesNotContain("new-tag").Contains("first commit"), ) }, })
View Source
var ForceTagLightweight = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Overwrite a lightweight tag that already exists", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("first commit") shell.CreateLightweightTag("new-tag", "HEAD") shell.EmptyCommit("second commit") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). Lines( Contains("second commit").IsSelected(), Contains("new-tag").Contains("first commit"), ). Press(keys.Commits.CreateTag). Tap(func() { t.ExpectPopup().CommitMessagePanel(). Title(Equals("Tag name")). Type("new-tag"). Confirm() }). Tap(func() { t.ExpectPopup().Confirmation(). Title(Equals("Force Tag")). Content(Contains("The tag 'new-tag' exists already. Press <esc> to cancel, or <enter> to overwrite.")). Confirm() }). Lines( Contains("new-tag").Contains("second commit"), DoesNotContain("new-tag").Contains("first commit"), ) }, })
View Source
var PushMultiple = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Push a range selection of tags", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("initial commit") shell.CloneIntoRemote("origin") for i := 1; i <= 4; i++ { shell.EmptyCommitWithDate(fmt.Sprintf("commit %02d", i), fmt.Sprintf("2024-01-%02d 10:00:00", i)) shell.CreateLightweightTag(fmt.Sprintf("tag-%02d", i), "HEAD") } }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). Lines( Contains("tag-04").IsSelected(), Contains("tag-03"), Contains("tag-02"), Contains("tag-01"), ). NavigateToLine(Contains("tag-03")). Press(keys.Universal.RangeSelectDown). Press(keys.Branches.PushTag). Tap(func() { t.ExpectPopup().Prompt(). Title(Equals("Remote to push the selected tags to:")). InitialText(Equals("origin")). Confirm() }). Lines( Contains("tag-04"), Contains("tag-03").IsSelected(), Contains("tag-02").IsSelected(), Contains("tag-01"), ) t.Git().RemoteTagNames("origin", []string{"tag-02", "tag-03"}) }, })
View Source
var Reset = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Hard reset to a tag", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.CreateLightweightTag("tag", "HEAD^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits().Lines( Contains("two"), Contains("one"), ) t.Views().Tags(). Focus(). Lines( Contains("tag").IsSelected(), ). Press(keys.Commits.ViewResetOptions) t.ExpectPopup().Menu(). Title(Contains("Reset to tag")). Select(Contains("Hard reset")). Confirm() t.Views().Commits().Lines( Contains("one"), ) }, })
View Source
var ResetToDuplicateNamedBranch = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Hard reset to a tag when a branch shares the same name", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.NewBranch("current-branch") shell.EmptyCommit("other-branch-tag commit") shell.CreateLightweightTag("other-branch", "HEAD") shell.EmptyCommit("other-branch commit") shell.NewBranch("other-branch") shell.Checkout("current-branch") shell.EmptyCommit("current-branch commit") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits().Lines( Contains("current-branch commit"), Contains("other-branch commit"), Contains("other-branch-tag commit"), ) t.Views().Tags(). Focus(). Lines( Contains("other-branch").IsSelected(), ). Press(keys.Commits.ViewResetOptions) t.ExpectPopup().Menu(). Title(Contains("Reset to other-branch")). Select(Contains("Hard reset")). Confirm() t.Views().Commits().Lines( Contains("other-branch-tag commit"), ) }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Source Files
¶
- checkout.go
- checkout_when_branch_with_same_name_exists.go
- copy_to_clipboard.go
- create_while_committing.go
- crud_annotated.go
- crud_lightweight.go
- delete_local_and_remote.go
- delete_multiple.go
- delete_remote_tag_when_branch_with_same_name_exists.go
- force_tag_annotated.go
- force_tag_lightweight.go
- push_multiple.go
- reset.go
- reset_to_duplicate_named_branch.go
Click to show internal directories.
Click to hide internal directories.