1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-05 00:59:19 +02:00
Files
lazygit/pkg/integration/tests/stash/pop.go
Chris McDonnell 265557afa2 Add unambigious refs/ prefix to all stash references
Pretty basic fix, didn't seem to have any complications.
I only added the refs/ prefix to the FullRefName() method
to align with other similar methods, and to make this change
not impact any user facing modals.

Fixes: https://github.com/jesseduffield/lazygit/issues/4634

Also adds a test demonstrating that the stash show behavior is now fixed
2025-06-15 16:14:59 +02:00

45 lines
1.0 KiB
Go

package stash
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var Pop = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Pop a stash entry",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("initial commit")
shell.NewBranch("stash")
shell.Checkout("master")
shell.CreateFile("file", "content")
shell.GitAddAll()
shell.Stash("stash one")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().IsEmpty()
t.Views().Stash().
Focus().
Lines(
Contains("stash one").IsSelected(),
).
Press(keys.Stash.PopStash).
Tap(func() {
t.ExpectPopup().Confirmation().
Title(Equals("Stash pop")).
Content(Contains("Are you sure you want to pop this stash entry?")).
Confirm()
}).
IsEmpty()
t.Views().Files().
IsFocused().
Lines(
Contains("file"),
)
},
})