mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-30 09:16:47 +02:00
add reset to tag test
This commit is contained in:
parent
daf8176dd7
commit
ee8c31880c
40
pkg/integration/tests/tag/reset.go
Normal file
40
pkg/integration/tests/tag/reset.go
Normal file
@ -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"),
|
||||
)
|
||||
},
|
||||
})
|
@ -89,6 +89,7 @@ var tests = []*components.IntegrationTest{
|
||||
tag.Checkout,
|
||||
tag.CrudAnnotated,
|
||||
tag.CrudLightweight,
|
||||
tag.Reset,
|
||||
undo.UndoCheckoutAndDrop,
|
||||
undo.UndoDrop,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user