tag

package
v0.0.0-...-8fc5405 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Checkout = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Checkout a tag",
	ExtraCmdArgs: "",
	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 CrudAnnotated = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Create and delete an annotated tag in the tags panel",
	ExtraCmdArgs: "",
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		shell.EmptyCommit("initial commit")
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Tags().
			Focus().
			IsEmpty().
			Press(keys.Universal.New).
			Tap(func() {
				t.ExpectPopup().Menu().
					Title(Equals("Create tag")).
					Select(Contains("annotated")).
					Confirm()

				t.ExpectPopup().Prompt().
					Title(Equals("Tag name:")).
					Type("new-tag").
					Confirm()

				t.ExpectPopup().Prompt().
					Title(Equals("Tag message:")).
					Type("message").
					Confirm()
			}).
			Lines(
				MatchesRegexp(`new-tag.*message`).IsSelected(),
			).
			Press(keys.Universal.Remove).
			Tap(func() {
				t.ExpectPopup().Confirmation().
					Title(Equals("Delete tag")).
					Content(Equals("Are you sure you want to delete tag 'new-tag'?")).
					Confirm()
			}).
			IsEmpty()
	},
})
View Source
var CrudLightweight = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Create and delete a lightweight tag in the tags panel",
	ExtraCmdArgs: "",
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		shell.EmptyCommit("initial commit")
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Tags().
			Focus().
			IsEmpty().
			Press(keys.Universal.New).
			Tap(func() {
				t.ExpectPopup().Menu().
					Title(Equals("Create tag")).
					Select(Contains("lightweight")).
					Confirm()

				t.ExpectPopup().Prompt().
					Title(Equals("Tag name:")).
					Type("new-tag").
					Confirm()
			}).
			Lines(
				MatchesRegexp(`new-tag.*initial commit`).IsSelected(),
			).
			PressEnter().
			Tap(func() {

				t.Views().SubCommits().IsFocused().
					Lines(
						Contains("initial commit"),
					).
					PressEscape()
			}).
			Press(keys.Universal.Remove).
			Tap(func() {
				t.ExpectPopup().Confirmation().
					Title(Equals("Delete tag")).
					Content(Equals("Are you sure you want to delete tag 'new-tag'?")).
					Confirm()
			}).
			IsEmpty()
	},
})
View Source
var Reset = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Hard reset to a tag",
	ExtraCmdArgs: "",
	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"),
		)
	},
})

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