diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-02-20 18:48:37 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-02-20 19:01:08 +1100 |
commit | ee8c31880c58f251b368c2c9d4af9aa1c59de6e4 (patch) | |
tree | 8951f520f30367754f2c17eb3854c79f4a83d3ec /pkg/integration | |
parent | daf8176dd74eedcbb4d4916f1e918bcae1361b95 (diff) |
add reset to tag test
Diffstat (limited to 'pkg/integration')
-rw-r--r-- | pkg/integration/tests/tag/reset.go | 40 | ||||
-rw-r--r-- | pkg/integration/tests/tests_gen.go | 1 |
2 files changed, 41 insertions, 0 deletions
diff --git a/pkg/integration/tests/tag/reset.go b/pkg/integration/tests/tag/reset.go new file mode 100644 index 000000000..1e2a9402b --- /dev/null +++ b/pkg/integration/tests/tag/reset.go @@ -0,0 +1,40 @@ +package tag + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +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^") // creating tag on commit "one" + }, + 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"), + ) + }, +}) diff --git a/pkg/integration/tests/tests_gen.go b/pkg/integration/tests/tests_gen.go index 1e32bd784..639a7743c 100644 --- a/pkg/integration/tests/tests_gen.go +++ b/pkg/integration/tests/tests_gen.go @@ -89,6 +89,7 @@ var tests = []*components.IntegrationTest{ tag.Checkout, tag.CrudAnnotated, tag.CrudLightweight, + tag.Reset, undo.UndoCheckoutAndDrop, undo.UndoDrop, } |