@@ -31,13 +31,22 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
3131 EmptyCommit ("on branch-four 01" ).
3232 PushBranchAndSetUpstream ("origin" , "branch-four" ).
3333 EmptyCommit ("on branch-four 02" ). // branch-four is not contained in any of these, so we get a delete confirmation
34+ NewBranchFrom ("branch-five" , "master" ).
35+ EmptyCommit ("on branch-five 01" ).
36+ PushBranchAndSetUpstream ("origin" , "branch-five" ). // branch-five is contained in its own upstream
37+ NewBranchFrom ("branch-six" , "master" ).
38+ EmptyCommit ("on branch-six 01" ).
39+ PushBranchAndSetUpstream ("origin" , "branch-six" ).
40+ EmptyCommit ("on branch-six 02" ). // branch-six is not contained in any of these, so we get a delete confirmation
3441 Checkout ("current-head" )
3542 },
3643 Run : func (t * TestDriver , keys config.KeybindingConfig ) {
3744 t .Views ().Branches ().
3845 Focus ().
3946 Lines (
4047 Contains ("current-head" ).IsSelected (),
48+ Contains ("branch-six ↑1" ),
49+ Contains ("branch-five ✓" ),
4150 Contains ("branch-four ↑1" ),
4251 Contains ("branch-three" ),
4352 Contains ("branch-two ✓" ),
@@ -62,7 +71,7 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
6271
6372 // Delete branch-four. This is the only branch that is not fully merged, so we get
6473 // a confirmation popup.
65- SelectNextItem ( ).
74+ NavigateToLine ( Contains ( "branch-four" ) ).
6675 Press (keys .Universal .Remove ).
6776 Tap (func () {
6877 t .ExpectPopup ().
@@ -78,6 +87,8 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
7887 }).
7988 Lines (
8089 Contains ("current-head" ),
90+ Contains ("branch-six ↑1" ),
91+ Contains ("branch-five ✓" ),
8192 Contains ("branch-three" ).IsSelected (),
8293 Contains ("branch-two ✓" ),
8394 Contains ("master" ),
@@ -96,6 +107,8 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
96107 }).
97108 Lines (
98109 Contains ("current-head" ),
110+ Contains ("branch-six ↑1" ),
111+ Contains ("branch-five ✓" ),
99112 Contains ("branch-two ✓" ).IsSelected (),
100113 Contains ("master" ),
101114 Contains ("branch-one ↑1" ),
@@ -113,6 +126,8 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
113126 }).
114127 Lines (
115128 Contains ("current-head" ),
129+ Contains ("branch-six ↑1" ),
130+ Contains ("branch-five ✓" ),
116131 Contains ("master" ).IsSelected (),
117132 Contains ("branch-one ↑1" ),
118133 ).
@@ -143,7 +158,9 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
143158 t .Views ().
144159 RemoteBranches ().
145160 Lines (
161+ Equals ("branch-five" ),
146162 Equals ("branch-four" ),
163+ Equals ("branch-six" ),
147164 Equals ("branch-two" ),
148165 ).
149166 Press (keys .Universal .Return )
@@ -154,6 +171,8 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
154171 }).
155172 Lines (
156173 Contains ("current-head" ),
174+ Contains ("branch-six ↑1" ),
175+ Contains ("branch-five ✓" ),
157176 Contains ("master" ),
158177 Contains ("branch-one (upstream gone)" ).IsSelected (),
159178 ).
@@ -168,6 +187,51 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
168187 Select (Contains ("Delete local branch" )).
169188 Confirm ()
170189 }).
190+ Lines (
191+ Contains ("current-head" ),
192+ Contains ("branch-six ↑1" ),
193+ Contains ("branch-five ✓" ),
194+ Contains ("master" ).IsSelected (),
195+ ).
196+
197+ // Delete both local and remote branch of branch-six. We get the force-delete warning because it is not fully merged.
198+ NavigateToLine (Contains ("branch-six" )).
199+ Press (keys .Universal .Remove ).
200+ Tap (func () {
201+ t .ExpectPopup ().
202+ Menu ().
203+ Title (Equals ("Delete branch 'branch-six'?" )).
204+ Select (Contains ("Delete local and remote branch" )).
205+ Confirm ()
206+ t .ExpectPopup ().
207+ Confirmation ().
208+ Title (Equals ("Delete local and remote branch" )).
209+ Content (Contains ("Are you sure you want to delete both 'branch-six' from your machine, and 'branch-six' from 'origin'?" ).
210+ Contains ("'branch-six' is not fully merged. Are you sure you want to delete it?" )).
211+ Confirm ()
212+ }).
213+ Lines (
214+ Contains ("current-head" ),
215+ Contains ("branch-five ✓" ).IsSelected (),
216+ Contains ("master" ),
217+ ).
218+
219+ // Delete both local and remote branch of branch-five. We get the same popups, but the confirmation
220+ // doesn't contain the force-delete warning.
221+ Press (keys .Universal .Remove ).
222+ Tap (func () {
223+ t .ExpectPopup ().
224+ Menu ().
225+ Title (Equals ("Delete branch 'branch-five'?" )).
226+ Select (Contains ("Delete local and remote branch" )).
227+ Confirm ()
228+ t .ExpectPopup ().
229+ Confirmation ().
230+ Title (Equals ("Delete local and remote branch" )).
231+ Content (Equals ("Are you sure you want to delete both 'branch-five' from your machine, and 'branch-five' from 'origin'?" ).
232+ DoesNotContain ("not fully merged" )).
233+ Confirm ()
234+ }).
171235 Lines (
172236 Contains ("current-head" ),
173237 Contains ("master" ).IsSelected (),
0 commit comments