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/drop.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

41 lines
1001 B
Go

package stash
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var Drop = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Drop 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.Universal.Remove).
Tap(func() {
t.ExpectPopup().Confirmation().
Title(Equals("Stash drop")).
Content(Contains("Are you sure you want to drop the selected stash entry(ies)?")).
Confirm()
}).
IsEmpty()
t.Views().Files().IsEmpty()
},
})