@@ -35,4 +35,37 @@ test('Render works correctly', async () => {
3535 } finally {
3636 await fs . remove ( tempDir ) ;
3737 }
38- } ) ;
38+ } ) ;
39+
40+ test ( 'Render works correctly with model without a description' , async ( ) => {
41+ const tempDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , 'vscode-test-sushi-' ) ) ;
42+ await fs . copy ( SUSHI_SOURCE_PATH , tempDir ) ;
43+
44+ try {
45+ const { window, close } = await startVSCode ( tempDir ) ;
46+
47+ // Wait for the models folder to be visible
48+ await window . waitForSelector ( 'text=models' ) ;
49+
50+ // Click on the models folder, excluding external_models
51+ await window . getByRole ( 'treeitem' , { name : 'models' , exact : true } ) . locator ( 'a' ) . click ( ) ;
52+
53+ // Open the latest_order model
54+ await window . getByRole ( 'treeitem' , { name : 'latest_order.sql' , exact : true } ) . locator ( 'a' ) . click ( ) ;
55+
56+ await window . waitForSelector ( 'text=custom_full_with_custom_kind' ) ;
57+ await window . waitForSelector ( 'text=Loaded SQLMesh Context' )
58+
59+ // Render the model
60+ await window . keyboard . press ( process . platform === 'darwin' ? 'Meta+Shift+P' : 'Control+Shift+P' ) ;
61+ await window . keyboard . type ( 'Render Model' ) ;
62+ await window . keyboard . press ( 'Enter' ) ;
63+
64+ // Check if the model is rendered correctly
65+ await expect ( window . locator ( 'text="orders"."id" AS "id",' ) ) . toBeVisible ( ) ;
66+
67+ await close ( ) ;
68+ } finally {
69+ await fs . remove ( tempDir ) ;
70+ }
71+ } ) ;
0 commit comments