1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

Use ErrorToast instead of error panel when invoking a disabled command

This commit is contained in:
Stefan Haller
2023-12-22 17:31:45 +01:00
parent 99a3ccde71
commit 09a24ee97d
13 changed files with 53 additions and 72 deletions

View File

@ -30,12 +30,11 @@ var CopyMenu = NewIntegrationTest(NewIntegrationTestArgs{
Title(Equals("Copy to clipboard")).
Select(Contains("File name")).
Tooltip(Equals("Disabled: Nothing to copy")).
Confirm()
t.ExpectPopup().Alert().
Title(Equals("Error")).
Content(Equals("Nothing to copy")).
Confirm()
Confirm().
Tap(func() {
t.ExpectToast(Equals("Disabled: Nothing to copy"))
}).
Cancel()
})
t.Shell().
@ -56,12 +55,11 @@ var CopyMenu = NewIntegrationTest(NewIntegrationTestArgs{
Title(Equals("Copy to clipboard")).
Select(Contains("Diff of selected file")).
Tooltip(Contains("Disabled: Nothing to copy")).
Confirm()
t.ExpectPopup().Alert().
Title(Equals("Error")).
Content(Equals("Nothing to copy")).
Confirm()
Confirm().
Tap(func() {
t.ExpectToast(Equals("Disabled: Nothing to copy"))
}).
Cancel()
}).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
@ -69,12 +67,11 @@ var CopyMenu = NewIntegrationTest(NewIntegrationTestArgs{
Title(Equals("Copy to clipboard")).
Select(Contains("Diff of all files")).
Tooltip(Contains("Disabled: Nothing to copy")).
Confirm()
t.ExpectPopup().Alert().
Title(Equals("Error")).
Content(Equals("Nothing to copy")).
Confirm()
Confirm().
Tap(func() {
t.ExpectToast(Equals("Disabled: Nothing to copy"))
}).
Cancel()
})
t.Shell().