1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

add create tag from commit test

This commit is contained in:
Jesse Duffield
2023-02-20 18:52:45 +11:00
parent ee8c31880c
commit 0b55eaca1d
4 changed files with 55 additions and 3 deletions

View File

@@ -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"})
},
})