@@ -5,41 +5,43 @@ import os from 'os'
55import { startVSCode , SUSHI_SOURCE_PATH } from './utils'
66
77test ( 'Model type hinting' , async ( ) => {
8- const tempDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , 'vscode-test-sushi-' ) )
9- await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
10-
11- try {
12- const { window, close } = await startVSCode ( tempDir )
13-
14- // Wait for the models folder to be visible
15- await window . waitForSelector ( 'text=models' )
16-
17- // Click on the models folder
18- await window
19- . getByRole ( 'treeitem' , { name : 'models' , exact : true } )
20- . locator ( 'a' )
21- . click ( )
22-
23- // Open the customers_revenue_by_day model
24- await window
25- . getByRole ( 'treeitem' , {
26- name : 'customer_revenue_by_day.sql' ,
27- exact : true ,
28- } )
29- . locator ( 'a' )
30- . click ( )
31-
32- await window . waitForSelector ( 'text=grain' )
33- await window . waitForSelector ( 'text=Loaded SQLMesh Context' )
34-
35- // Wait a moment for hints to appear
36- await window . waitForTimeout ( 500 )
37-
38- // Check if the hint is visible
39- expect ( await window . locator ( 'text="country code"::INT' ) . count ( ) ) . toBe ( 1 )
40-
41- await close ( )
42- } finally {
43- await fs . remove ( tempDir )
44- }
8+ const tempDir = await fs . mkdtemp (
9+ path . join ( os . tmpdir ( ) , 'vscode-test-sushi-' ) ,
10+ )
11+ await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
12+
13+ try {
14+ const { window, close } = await startVSCode ( tempDir )
15+
16+ // Wait for the models folder to be visible
17+ await window . waitForSelector ( 'text=models' )
18+
19+ // Click on the models folder
20+ await window
21+ . getByRole ( 'treeitem' , { name : 'models' , exact : true } )
22+ . locator ( 'a' )
23+ . click ( )
24+
25+ // Open the customers_revenue_by_day model
26+ await window
27+ . getByRole ( 'treeitem' , {
28+ name : 'customer_revenue_by_day.sql' ,
29+ exact : true ,
30+ } )
31+ . locator ( 'a' )
32+ . click ( )
33+
34+ await window . waitForSelector ( 'text=grain' )
35+ await window . waitForSelector ( 'text=Loaded SQLMesh Context' )
36+
37+ // Wait a moment for hints to appear
38+ await window . waitForTimeout ( 500 )
39+
40+ // Check if the hint is visible
41+ expect ( await window . locator ( 'text="country code"::INT' ) . count ( ) ) . toBe ( 1 )
42+
43+ await close ( )
44+ } finally {
45+ await fs . remove ( tempDir )
46+ }
4547} )
0 commit comments