@@ -115,4 +115,33 @@ test.describe('Query History', () => {
115115 const value = await queryEditor . resultTable . getCellValue ( 1 , 2 ) ;
116116 expect ( value ) . toBe ( '42' ) ;
117117 } ) ;
118+
119+ test ( 'Can search in query history' , async ( ) => {
120+ const queries = [
121+ 'SELECT 1 AS first_test;' ,
122+ 'SELECT 2 AS second_test;' ,
123+ 'SELECT 3 AS another_query;' ,
124+ ] ;
125+
126+ // Execute multiple queries
127+ for ( const query of queries ) {
128+ await queryEditor . run ( query , QUERY_MODES . script ) ;
129+ }
130+
131+ // Navigate to the history tab
132+ await queryEditor . queryTabs . selectTab ( QueryTabs . History ) ;
133+ await queryEditor . historyQueries . isVisible ( ) ;
134+
135+ // Search for "test" queries
136+ await queryEditor . historyQueries . search ( 'test' ) ;
137+
138+ // Verify only queries with "test" are visible
139+ const firstQueryRow = await queryEditor . historyQueries . getQueryRow ( queries [ 0 ] ) ;
140+ const secondQueryRow = await queryEditor . historyQueries . getQueryRow ( queries [ 1 ] ) ;
141+ const otherQueryRow = await queryEditor . historyQueries . getQueryRow ( queries [ 2 ] ) ;
142+
143+ await expect ( firstQueryRow ) . toBeVisible ( ) ;
144+ await expect ( secondQueryRow ) . toBeVisible ( ) ;
145+ await expect ( otherQueryRow ) . not . toBeVisible ( ) ;
146+ } ) ;
118147} ) ;
0 commit comments