1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-15 22:26:40 +02:00
lazygit/pkg/integration/tests/commit/disable_copy_commit_message_body.go
2025-02-17 18:43:39 +01:00

34 lines
855 B
Go

package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DisableCopyCommitMessageBody = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Disables copy commit message body when there is no body",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("commit")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("commit").IsSelected(),
).
Press(keys.Commits.CopyCommitAttributeToClipboard)
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Commit message body")).
Confirm()
t.ExpectToast(Equals("Disabled: Commit has no message body"))
},
})