File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ func (self *Popup) Alert() *AlertDriver {
36
36
return & AlertDriver {t : self .t }
37
37
}
38
38
39
+ func (self * AlertDriver ) Tap (f func ()) * AlertDriver {
40
+ self .getViewDriver ().Tap (f )
41
+ return self
42
+ }
43
+
39
44
func (self * Popup ) inAlert () {
40
45
// basically the same thing as a confirmation popup with the current implementation
41
46
self .t .assertWithRetries (func () (bool , string ) {
Original file line number Diff line number Diff line change
1
+ package misc
2
+
3
+ import (
4
+ "github.com/jesseduffield/lazygit/pkg/config"
5
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
6
+ )
7
+
8
+ var CopyConfirmationMessageToClipboard = NewIntegrationTest (NewIntegrationTestArgs {
9
+ Description : "Copy the text of a confirmation popup to the clipboard" ,
10
+ ExtraCmdArgs : []string {},
11
+ Skip : false ,
12
+ SetupConfig : func (config * config.AppConfig ) {
13
+ config .GetUserConfig ().OS .CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
14
+ },
15
+
16
+ SetupRepo : func (shell * Shell ) {
17
+ shell .EmptyCommit ("commit" )
18
+ },
19
+
20
+ Run : func (t * TestDriver , keys config.KeybindingConfig ) {
21
+ t .Views ().Commits ().
22
+ Focus ().
23
+ Lines (
24
+ Contains ("commit" ).IsSelected (),
25
+ ).
26
+ Press (keys .Universal .Remove )
27
+
28
+ t .ExpectPopup ().Alert ().
29
+ Title (Equals ("Drop commit" )).
30
+ Content (Equals ("Are you sure you want to drop the selected commit(s)?" )).
31
+ Tap (func () {
32
+ t .GlobalPress (keys .Universal .CopyToClipboard )
33
+ t .ExpectToast (Equals ("Message copied to clipboard" ))
34
+ }).
35
+ Confirm ()
36
+
37
+ t .FileSystem ().FileContent ("clipboard" ,
38
+ Equals ("Are you sure you want to drop the selected commit(s)?" ))
39
+ },
40
+ })
Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ var tests = []*components.IntegrationTest{
299
299
interactive_rebase .SwapWithConflict ,
300
300
interactive_rebase .ViewFilesOfTodoEntries ,
301
301
misc .ConfirmOnQuit ,
302
+ misc .CopyConfirmationMessageToClipboard ,
302
303
misc .CopyToClipboard ,
303
304
misc .DisabledKeybindings ,
304
305
misc .InitialOpen ,
You can’t perform that action at this time.
0 commit comments