This repository was archived by the owner on Dec 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ module.exports = () => {
79
79
80
80
} ) ;
81
81
82
+ // we need to override the repl's global onpaste handler; see shell issue #693
83
+ searchInput . onpaste = evt => {
84
+ evt . stopPropagation ( )
85
+ }
86
+
82
87
searchInput . addEventListener ( 'click' , e => {
83
88
searchInput . focus ( ) ;
84
89
} ) ;
Original file line number Diff line number Diff line change @@ -108,4 +108,19 @@ describe('Text search', function() {
108
108
. then ( txt => txt === 'no matches' )
109
109
} ) )
110
110
. catch ( common . oops ( this ) ) )
111
+
112
+ // paste test
113
+ it ( 'should close the search bar if clicking the close button' , ( ) => this . app . client . click ( '#search-close-button' )
114
+ . then ( ( ) => this . app . client . waitForVisible ( '#search-bar' , 2000 , false ) )
115
+ . catch ( common . oops ( this ) ) )
116
+ it ( 'should paste into the text search box' , ( ) => this . app . client . keys ( [ ui . ctrlOrMeta , 'f' ] )
117
+ . then ( ( ) => this . app . client . waitForVisible ( '#search-bar' ) )
118
+ . then ( ( ) => this . app . client . hasFocus ( '#search-input' ) )
119
+ . then ( r => assert . ok ( r , 'assert if search-input is focused' ) )
120
+ . then ( ( ) => this . app . electron . clipboard . writeText ( 'grumble' ) )
121
+ . then ( ( ) => this . app . client . execute ( ( ) => document . execCommand ( 'paste' ) ) )
122
+ . then ( ( ) => this . app . client . getValue ( '#search-input' ) )
123
+ . then ( actual => assert . equal ( actual , 'grumble' ) ) // paste made it to #search-input?
124
+ . catch ( common . oops ( this ) ) )
125
+
111
126
} )
You can’t perform that action at this time.
0 commit comments