diff options
Diffstat (limited to 'pkg')
-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, } |