1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-23 00:39:13 +02:00

move popup assertions into a struct

This commit is contained in:
Jesse Duffield
2022-12-28 11:00:22 +11:00
parent 7aa843c75a
commit 9fef4447b6
33 changed files with 130 additions and 120 deletions

View File

@ -27,9 +27,9 @@ var CheckoutByName = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
Press(keys.Branches.CheckoutBranchByName).
Tap(func() {
t.ExpectPrompt().Title(Equals("Branch name:")).Type("new-branch").Confirm()
t.ExpectPopup().Prompt().Title(Equals("Branch name:")).Type("new-branch").Confirm()
t.ExpectAlert().Title(Equals("Branch not found")).Content(Equals("Branch not found. Create a new branch named new-branch?")).Confirm()
t.ExpectPopup().Alert().Title(Equals("Branch not found")).Content(Equals("Branch not found. Create a new branch named new-branch?")).Confirm()
}).
Lines(
MatchesRegexp(`\*.*new-branch`).IsSelected(),

View File

@ -26,12 +26,12 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
).
Press(keys.Universal.Remove).
Tap(func() {
t.ExpectAlert().Title(Equals("Error")).Content(Contains("You cannot delete the checked out branch!")).Confirm()
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("You cannot delete the checked out branch!")).Confirm()
}).
SelectNextItem().
Press(keys.Universal.Remove).
Tap(func() {
t.ExpectConfirmation().
t.ExpectPopup().Confirmation().
Title(Equals("Delete Branch")).
Content(Contains("Are you sure you want to delete the branch 'branch-one'?")).
Confirm()

View File

@ -30,12 +30,12 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
Press(keys.Branches.RebaseBranch)
t.ExpectConfirmation().
t.ExpectPopup().Confirmation().
Title(Equals("Rebasing")).
Content(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?")).
Confirm()
t.ExpectConfirmation().
t.ExpectPopup().Confirmation().
Title(Equals("Auto-merge failed")).
Content(Contains("Conflicts!")).
Confirm()
@ -51,7 +51,7 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Information().Content(Contains("rebasing"))
t.ExpectConfirmation().
t.ExpectPopup().Confirmation().
Title(Equals("continue")).
Content(Contains("all merge conflicts resolved. Continue?")).
Confirm()

View File

@ -36,14 +36,14 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
Press(keys.Branches.RebaseBranch)
t.ExpectConfirmation().
t.ExpectPopup().Confirmation().
Title(Equals("Rebasing")).
Content(Contains("Are you sure you want to rebase 'first-change-branch' on top of 'second-change-branch'?")).
Confirm()
t.Views().Information().Content(Contains("rebasing"))
t.ExpectConfirmation().
t.ExpectPopup().Confirmation().
Title(Equals("Auto-merge failed")).
Content(Contains("Conflicts!")).
Confirm()
@ -78,7 +78,7 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
IsFocused().
PressPrimaryAction()
t.ExpectConfirmation().
t.ExpectPopup().Confirmation().
Title(Equals("continue")).
Content(Contains("all merge conflicts resolved. Continue?")).
Confirm()

View File

@ -35,7 +35,7 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
Press(keys.Commits.ViewResetOptions)
t.ExpectMenu().
t.ExpectPopup().Menu().
Title(Contains("reset to other-branch")).
Select(Contains("hard reset")).
Confirm()

View File

@ -27,7 +27,7 @@ var Suggestions = NewIntegrationTest(NewIntegrationTestArgs{
// we expect the first suggestion to be the branch we want because it most
// closely matches what we typed in
t.ExpectPrompt().
t.ExpectPopup().Prompt().
Title(Equals("Branch name:")).
Type("branch-to").
SuggestionTopLines(Contains("branch-to-checkout")).