diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-02-20 18:52:45 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-02-20 19:01:08 +1100 |
commit | 0b55eaca1d3d2b52df0531ca2da613fabb799c18 (patch) | |
tree | 67d5c35fcc52e367e1e981b9fb4653f468e8c814 /pkg/integration | |
parent | ee8c31880c58f251b368c2c9d4af9aa1c59de6e4 (diff) |
add create tag from commit test
Diffstat (limited to 'pkg/integration')
-rw-r--r-- | pkg/integration/tests/commit/create_tag.go | 51 | ||||
-rw-r--r-- | pkg/integration/tests/tests_gen.go | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/pkg/integration/tests/commit/create_tag.go b/pkg/integration/tests/commit/create_tag.go new file mode 100644 index 000000000..4b749b235 --- /dev/null +++ b/pkg/integration/tests/commit/create_tag.go @@ -0,0 +1,51 @@ +package commit + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var CreateTag = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Create a new tag on a commit", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.EmptyCommit("one") + shell.EmptyCommit("two") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Focus(). + Lines( + Contains("two").IsSelected(), + Contains("one"), + ). + Press(keys.Commits.CreateTag) + + t.ExpectPopup().Menu(). + Title(Equals("Create tag")). + Select(Contains("lightweight")). + Confirm() + + t.ExpectPopup().Prompt(). + Title(Equals("Tag name:")). + Type("new-tag"). + Confirm() + + t.Views().Commits(). + Lines( + MatchesRegexp(`new-tag.*two`).IsSelected(), + MatchesRegexp(`one`), + ) + + t.Views().Tags(). + Focus(). + Lines( + MatchesRegexp(`new-tag.*two`).IsSelected(), + ) + + t.Git(). + TagNamesAt("HEAD", []string{"new-tag"}) + }, +}) diff --git a/pkg/integration/tests/tests_gen.go b/pkg/integration/tests/tests_gen.go index 639a7743c..e2336f6be 100644 --- a/pkg/integration/tests/tests_gen.go +++ b/pkg/integration/tests/tests_gen.go @@ -41,6 +41,7 @@ var tests = []*components.IntegrationTest{ cherry_pick.CherryPickConflicts, commit.Commit, commit.CommitMultiline, + commit.CreateTag, commit.DiscardOldFileChange, commit.NewBranch, commit.Revert, |