@@ -36,7 +36,8 @@ test.describe('Apex Hover Functionality', () => {
3636 await hoverHelper . hoverOnWord ( 'ApexClassExample' ) ;
3737 const content = await hoverHelper . getHoverContent ( ) ;
3838 expect ( content . length ) . toBeGreaterThan ( 0 ) ;
39- console . log ( `✅ Class hover content: ${ content . substring ( 0 , 50 ) } ...` ) ;
39+ expect ( content ) . toMatch ( / c l a s s \b / i) ;
40+ expect ( content ) . toContain ( 'ApexClassExample' ) ;
4041 } ) ;
4142
4243 /**
@@ -46,8 +47,7 @@ test.describe('Apex Hover Functionality', () => {
4647 await hoverHelper . hoverOnWord ( 'DEFAULT_STATUS' ) ;
4748 const content = await hoverHelper . getHoverContent ( ) ;
4849 expect ( content ) . toBeTruthy ( ) ;
49- expect ( content . length ) . toBeGreaterThan ( 0 ) ;
50- console . log ( '✅ Static variable hover provided' ) ;
50+ expect ( content ) . toContain ( 'String' ) ;
5151 } ) ;
5252
5353 /**
@@ -57,17 +57,17 @@ test.describe('Apex Hover Functionality', () => {
5757 await hoverHelper . hoverOnWord ( 'instanceId' ) ;
5858 const content = await hoverHelper . getHoverContent ( ) ;
5959 expect ( content ) . toBeTruthy ( ) ;
60- console . log ( '✅ Instance variable hover provided ') ;
60+ expect ( content ) . toContain ( 'String ') ;
6161 } ) ;
6262
6363 /**
6464 * Test: Hover on method name shows method signature.
6565 */
6666 test ( 'should show hover for method name' , async ( { hoverHelper } ) => {
6767 await hoverHelper . hoverOnWord ( 'sayHello' ) ;
68- const hasMethodSig = await hoverHelper . hasMethodSignature ( ) ;
69- expect ( hasMethodSig ) . toBe ( true ) ;
70- console . log ( '✅ Method hover shows signature ') ;
68+ const content = await hoverHelper . getHoverContent ( ) ;
69+ expect ( content ) . toContain ( 'void' ) ;
70+ expect ( content ) . toContain ( 'sayHello ') ;
7171 } ) ;
7272
7373 /**
@@ -77,8 +77,8 @@ test.describe('Apex Hover Functionality', () => {
7777 await hoverHelper . hoverOnWord ( 'Configuration' ) ;
7878 const content = await hoverHelper . getHoverContent ( ) ;
7979 expect ( content ) . toBeTruthy ( ) ;
80- expect ( content . length ) . toBeGreaterThan ( 0 ) ;
81- console . log ( '✅ Inner class hover provided' ) ;
80+ expect ( content ) . toContain ( 'Configuration' ) ;
81+ expect ( content ) . toMatch ( / c l a s s \b / i ) ;
8282 } ) ;
8383
8484 /**
@@ -93,24 +93,24 @@ test.describe('Apex Hover Functionality', () => {
9393 content = await hoverHelper . getHoverContent ( ) ;
9494 }
9595 expect ( content ) . toBeTruthy ( ) ;
96- console . log ( '✅ Inner enum hover provided' ) ;
96+ expect ( content ) . toContain ( 'StatusType' ) ;
97+ expect ( content ) . toMatch ( / e n u m \b / i) ;
9798 } ) ;
9899
99100 /**
100101 * Test: Hover contains type information for typed symbols.
101102 */
102103 test ( 'should show type information in hover' , async ( { hoverHelper } ) => {
103104 await hoverHelper . hoverOnWord ( 'instanceId' ) ;
104- const hasTypeInfo = await hoverHelper . hasTypeInformation ( ) ;
105- expect ( hasTypeInfo ) . toBe ( true ) ;
106- console . log ( '✅ Hover contains type information ') ;
105+ const content = await hoverHelper . getHoverContent ( ) ;
106+ // Verify actual type name appears, not just any keyword
107+ expect ( content ) . toContain ( 'String ') ;
107108 } ) ;
108109
109110 /**
110111 * Test: Hover is responsive (appears within reasonable time).
111112 */
112113 test ( 'should show hover within reasonable time' , async ( { hoverHelper } ) => {
113- // LSP hover can take a few seconds to resolve in web environment
114114 const isResponsive = await hoverHelper . isHoverResponsive (
115115 'ApexClassExample' ,
116116 12000 ,
@@ -134,7 +134,6 @@ test.describe('Apex Hover Functionality', () => {
134134 } ) ;
135135
136136 expect ( await hoverHelper . isHoverVisible ( ) ) . toBe ( false ) ;
137- console . log ( '✅ Hover can be dismissed' ) ;
138137 } ) ;
139138
140139 /**
@@ -145,8 +144,8 @@ test.describe('Apex Hover Functionality', () => {
145144 } ) => {
146145 await hoverHelper . hoverOnWord ( 'add' ) ;
147146 const content = await hoverHelper . getHoverContent ( ) ;
148- expect ( content ) . toBeTruthy ( ) ;
149- console . log ( '✅ Method with parameters shows signature in hover' ) ;
147+ expect ( content ) . toMatch ( / I n t e g e r / ) ;
148+ expect ( content ) . toMatch ( / a d d / ) ;
150149 } ) ;
151150
152151 /**
@@ -155,12 +154,10 @@ test.describe('Apex Hover Functionality', () => {
155154 test ( 'should show generic type for List variable' , async ( {
156155 hoverHelper,
157156 } ) => {
158- await hoverHelper . hoverOnWord ( 'List<Account> accounts' ) ;
157+ await hoverHelper . hoverOnWord ( 'accounts' ) ;
159158 const content = await hoverHelper . getHoverContent ( ) ;
160- const hasTypeInfo = await hoverHelper . hasTypeInformation ( ) ;
161- expect ( hasTypeInfo ) . toBe ( true ) ;
162159 expect ( content ) . toBeTruthy ( ) ;
163- console . log ( '✅ List variable hover shows generic type' ) ;
160+ expect ( content ) . toMatch ( / L i s t | A c c o u n t / ) ;
164161 } ) ;
165162
166163 /**
@@ -169,31 +166,29 @@ test.describe('Apex Hover Functionality', () => {
169166 test ( 'should show generic types for Map variable' , async ( {
170167 hoverHelper,
171168 } ) => {
172- await hoverHelper . hoverOnWord ( 'Map<Id, Account> accountMap' ) ;
169+ await hoverHelper . hoverOnWord ( 'accountMap' ) ;
173170 const content = await hoverHelper . getHoverContent ( ) ;
174171 expect ( content ) . toBeTruthy ( ) ;
175- console . log ( '✅ Map variable hover shows generic types' ) ;
172+ expect ( content ) . toMatch ( / M a p | A c c o u n t / ) ;
176173 } ) ;
177174
178175 /**
179176 * Test: Multiple hovers can be triggered sequentially.
180177 */
181178 test ( 'should handle multiple sequential hovers' , async ( { hoverHelper } ) => {
182179 await hoverHelper . hoverOnWord ( 'ApexClassExample' ) ;
183- let content1 = await hoverHelper . getHoverContent ( ) ;
184- expect ( content1 ) . toBeTruthy ( ) ;
180+ const content1 = await hoverHelper . getHoverContent ( ) ;
181+ expect ( content1 ) . toContain ( 'ApexClassExample' ) ;
185182
186183 await hoverHelper . dismissHover ( ) ;
187184 await hoverHelper . hoverOnWord ( 'Configuration' ) ;
188- let content2 = await hoverHelper . getHoverContent ( ) ;
189- expect ( content2 ) . toBeTruthy ( ) ;
185+ const content2 = await hoverHelper . getHoverContent ( ) ;
186+ expect ( content2 ) . toContain ( 'Configuration' ) ;
190187
191188 await hoverHelper . dismissHover ( ) ;
192189 await hoverHelper . hoverOnWord ( 'StatusType' ) ;
193- let content3 = await hoverHelper . getHoverContent ( ) ;
194- expect ( content3 ) . toBeTruthy ( ) ;
195-
196- console . log ( '✅ Multiple sequential hovers work correctly' ) ;
190+ const content3 = await hoverHelper . getHoverContent ( ) ;
191+ expect ( content3 ) . toContain ( 'StatusType' ) ;
197192 } ) ;
198193
199194 /**
@@ -208,7 +203,7 @@ test.describe('Apex Hover Functionality', () => {
208203 content = await hoverHelper . getHoverContent ( ) ;
209204 }
210205 expect ( content ) . toBeTruthy ( ) ;
211- console . log ( '✅ Constructor hover provided ') ;
206+ expect ( content ) . toContain ( 'ApexClassExample ') ;
212207 } ) ;
213208
214209 /**
@@ -219,7 +214,7 @@ test.describe('Apex Hover Functionality', () => {
219214 const content = await hoverHelper . getHoverContent ( ) ;
220215 expect ( content . length ) . toBeGreaterThan ( 0 ) ;
221216 expect ( content . trim ( ) ) . not . toBe ( '' ) ;
222- console . log ( `✅ Hover content is non-empty ( ${ content . length } chars)` ) ;
217+ expect ( content ) . toContain ( 'ApexClassExample' ) ;
223218 } ) ;
224219
225220 /**
@@ -228,8 +223,8 @@ test.describe('Apex Hover Functionality', () => {
228223 test ( 'should show hover for private method' , async ( { hoverHelper } ) => {
229224 await hoverHelper . hoverOnWord ( 'validateAccounts' ) ;
230225 const content = await hoverHelper . getHoverContent ( ) ;
231- expect ( content ) . toBeTruthy ( ) ;
232- console . log ( '✅ Private method hover provided ') ;
226+ expect ( content ) . toContain ( 'void' ) ;
227+ expect ( content ) . toContain ( 'validateAccounts ') ;
233228 } ) ;
234229
235230 /**
@@ -240,14 +235,15 @@ test.describe('Apex Hover Functionality', () => {
240235 } ) => {
241236 await hoverHelper . hoverOnWord ( 'ApexClassExample' ) ;
242237 const classHover = await hoverHelper . getHoverContent ( ) ;
238+ expect ( classHover ) . toMatch ( / c l a s s \b / i) ;
243239
244240 await hoverHelper . dismissHover ( ) ;
245241
246242 await hoverHelper . hoverOnWord ( 'sayHello' ) ;
247243 const methodHover = await hoverHelper . getHoverContent ( ) ;
244+ expect ( methodHover ) . toMatch ( / v o i d / ) ;
248245
249246 expect ( classHover ) . not . toBe ( methodHover ) ;
250- console . log ( '✅ Different symbols provide different hover content' ) ;
251247 } ) ;
252248
253249 /**
@@ -261,8 +257,6 @@ test.describe('Apex Hover Functionality', () => {
261257 expect ( content . length ) . toBeGreaterThan ( 0 ) ;
262258
263259 await hoverHelper . captureHoverScreenshot ( 'test-hover' ) ;
264-
265- console . log ( '✅ Hover screenshot captured successfully' ) ;
266260 } ) ;
267261} ) ;
268262
0 commit comments