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:
@ -34,10 +34,7 @@ var AmendNonHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
NavigateToLine(Contains(commit)).
|
||||
Press(keys.Commits.AmendToCommit)
|
||||
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Contains("Can't perform this action during a rebase")).
|
||||
Confirm()
|
||||
t.ExpectToast(Contains("Can't perform this action during a rebase"))
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -29,9 +29,6 @@ var EditNonTodoCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
NavigateToLine(Contains("commit 01")).
|
||||
Press(keys.Universal.Edit)
|
||||
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Contains("Can't perform this action during a rebase")).
|
||||
Confirm()
|
||||
t.ExpectToast(Contains("Can't perform this action during a rebase"))
|
||||
},
|
||||
})
|
||||
|
@ -39,9 +39,6 @@ var EditTheConflCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
NavigateToLine(Contains("<-- YOU ARE HERE --- commit three")).
|
||||
Press(keys.Commits.RenameCommit)
|
||||
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Contains("Changing this kind of rebase todo entry is not allowed")).
|
||||
Confirm()
|
||||
t.ExpectToast(Contains("Changing this kind of rebase todo entry is not allowed"))
|
||||
},
|
||||
})
|
||||
|
@ -24,10 +24,7 @@ var FixupFirstCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
NavigateToLine(Contains("commit 01")).
|
||||
Press(keys.Commits.MarkCommitAsFixup).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Equals("There's no commit below to squash into")).
|
||||
Confirm()
|
||||
t.ExpectToast(Equals("Disabled: There's no commit below to squash into"))
|
||||
}).
|
||||
Lines(
|
||||
Contains("commit 02"),
|
||||
|
@ -50,13 +50,9 @@ var QuickStart = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Contains("initial commit"),
|
||||
).
|
||||
// Verify we can't quick start from main
|
||||
Press(keys.Commits.StartInteractiveRebase).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Contains("Cannot start interactive rebase: the HEAD commit is a merge commit or is present on the main branch, so there is no appropriate base commit to start the rebase from. You can start an interactive rebase from a specific commit by selecting the commit and pressing `e`.")).
|
||||
Confirm()
|
||||
})
|
||||
Press(keys.Commits.StartInteractiveRebase)
|
||||
|
||||
t.ExpectToast(Equals("Disabled: Cannot start interactive rebase: the HEAD commit is a merge commit or is present on the main branch, so there is no appropriate base commit to start the rebase from. You can start an interactive rebase from a specific commit by selecting the commit and pressing `e`."))
|
||||
|
||||
t.Views().Branches().
|
||||
Focus().
|
||||
@ -80,15 +76,10 @@ var QuickStart = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Contains("initial commit"),
|
||||
).
|
||||
// Try again, verify we fail because we're already rebasing
|
||||
Press(keys.Commits.StartInteractiveRebase).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Contains("Can't perform this action during a rebase")).
|
||||
Confirm()
|
||||
Press(keys.Commits.StartInteractiveRebase)
|
||||
|
||||
t.Common().AbortRebase()
|
||||
})
|
||||
t.ExpectToast(Equals("Disabled: Can't perform this action during a rebase"))
|
||||
t.Common().AbortRebase()
|
||||
|
||||
// Verify if a merge commit is present on the branch we start from there
|
||||
t.Views().Branches().
|
||||
|
@ -24,10 +24,7 @@ var SquashDownFirstCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
NavigateToLine(Contains("commit 01")).
|
||||
Press(keys.Commits.SquashDown).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Equals("There's no commit below to squash into")).
|
||||
Confirm()
|
||||
t.ExpectToast(Equals("Disabled: There's no commit below to squash into"))
|
||||
}).
|
||||
Lines(
|
||||
Contains("commit 02"),
|
||||
|
Reference in New Issue
Block a user