diff options
Diffstat (limited to 'pkg/integration/tests')
-rw-r--r-- | pkg/integration/tests/branch/create_tag.go | 9 | ||||
-rw-r--r-- | pkg/integration/tests/commit/create_tag.go | 9 | ||||
-rw-r--r-- | pkg/integration/tests/tag/create_while_committing.go | 37 | ||||
-rw-r--r-- | pkg/integration/tests/tag/crud_annotated.go | 25 | ||||
-rw-r--r-- | pkg/integration/tests/tag/crud_lightweight.go | 9 | ||||
-rw-r--r-- | pkg/integration/tests/test_list.go | 1 |
6 files changed, 57 insertions, 33 deletions
diff --git a/pkg/integration/tests/branch/create_tag.go b/pkg/integration/tests/branch/create_tag.go index 68f91ec1b..9ea100f4f 100644 --- a/pkg/integration/tests/branch/create_tag.go +++ b/pkg/integration/tests/branch/create_tag.go @@ -26,13 +26,8 @@ var CreateTag = NewIntegrationTest(NewIntegrationTestArgs{ SelectNextItem(). Press(keys.Branches.CreateTag) - t.ExpectPopup().Menu(). - Title(Equals("Create tag")). - Select(Contains("Lightweight")). - Confirm() - - t.ExpectPopup().Prompt(). - Title(Equals("Tag name:")). + t.ExpectPopup().CommitMessagePanel(). + Title(Equals("Tag name")). Type("new-tag"). Confirm() diff --git a/pkg/integration/tests/commit/create_tag.go b/pkg/integration/tests/commit/create_tag.go index 22a4baa86..f068f271b 100644 --- a/pkg/integration/tests/commit/create_tag.go +++ b/pkg/integration/tests/commit/create_tag.go @@ -23,13 +23,8 @@ var CreateTag = NewIntegrationTest(NewIntegrationTestArgs{ ). Press(keys.Commits.CreateTag) - t.ExpectPopup().Menu(). - Title(Equals("Create tag")). - Select(Contains("Lightweight")). - Confirm() - - t.ExpectPopup().Prompt(). - Title(Equals("Tag name:")). + t.ExpectPopup().CommitMessagePanel(). + Title(Equals("Tag name")). Type("new-tag"). Confirm() diff --git a/pkg/integration/tests/tag/create_while_committing.go b/pkg/integration/tests/tag/create_while_committing.go new file mode 100644 index 000000000..88d31f759 --- /dev/null +++ b/pkg/integration/tests/tag/create_while_committing.go @@ -0,0 +1,37 @@ +package tag + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +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("")) + }) + }, +}) diff --git a/pkg/integration/tests/tag/crud_annotated.go b/pkg/integration/tests/tag/crud_annotated.go index af40b32df..d32c7f265 100644 --- a/pkg/integration/tests/tag/crud_annotated.go +++ b/pkg/integration/tests/tag/crud_annotated.go @@ -19,19 +19,13 @@ var CrudAnnotated = NewIntegrationTest(NewIntegrationTestArgs{ 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:")). + t.ExpectPopup().CommitMessagePanel(). + Title(Equals("Tag name")). Type("new-tag"). - Confirm() - - t.ExpectPopup().Prompt(). - Title(Equals("Tag message:")). + SwitchToDescription(). + Title(Equals("Tag description")). Type("message"). + SwitchToSummary(). Confirm() }). Lines( @@ -44,6 +38,13 @@ var CrudAnnotated = NewIntegrationTest(NewIntegrationTestArgs{ Content(Equals("Are you sure you want to delete tag 'new-tag'?")). Confirm() }). - IsEmpty() + IsEmpty(). + Press(keys.Universal.New). + Tap(func() { + // confirm content is cleared on next tag create + t.ExpectPopup().CommitMessagePanel(). + Title(Equals("Tag name")). + InitialText(Equals("")) + }) }, }) diff --git a/pkg/integration/tests/tag/crud_lightweight.go b/pkg/integration/tests/tag/crud_lightweight.go index 12d75a05a..ce5ff9e42 100644 --- a/pkg/integration/tests/tag/crud_lightweight.go +++ b/pkg/integration/tests/tag/crud_lightweight.go @@ -19,13 +19,8 @@ var CrudLightweight = NewIntegrationTest(NewIntegrationTestArgs{ 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:")). + t.ExpectPopup().CommitMessagePanel(). + Title(Equals("Tag name")). Type("new-tag"). Confirm() }). diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index aa43dd2c1..1af3890dd 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -207,6 +207,7 @@ var tests = []*components.IntegrationTest{ sync.PushWithCredentialPrompt, sync.RenameBranchAndPull, tag.Checkout, + tag.CreateWhileCommitting, tag.CrudAnnotated, tag.CrudLightweight, tag.Reset, |