Skip to content

Commit 5efefac

Browse files
fix(vscode): save the editor after the noselectstar quickfix
The code action only updates the open buffer, so the e2e test was still reading SELECT * from disk on CI. Signed-off-by: stuffbyyuki <kake.19940627@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a1d1ac8 commit 5efefac

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎vscode/extension/tests/quickfix.spec.ts‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import fs from 'fs-extra'
22
import path from 'path'
33
import {
44
openProblemsView,
5+
saveFile,
56
SUSHI_SOURCE_PATH,
67
waitForLoadedSQLMesh,
78
} from './utils'
@@ -78,13 +79,21 @@ test('noselectstar quickfix', async ({ page, sharedCodeServer, tempDir }) => {
7879
})
7980
await replaceSelectStar.first().waitFor({ state: 'visible' })
8081
await replaceSelectStar.first().click()
82+
// The code action edits the open document. It stays unsaved until the
83+
// editor writes it, so the on-disk assertion below would keep seeing
84+
// SELECT * on a busy CI runner.
85+
await quickFixMenu.waitFor({ state: 'hidden' })
86+
await saveFile(page)
8187

8288
// Wait for the quick fix to be applied by polling the file content
8389
await expect
84-
.poll(async () => {
85-
const content = (await fs.readFile(modelPath)).toString('utf8')
86-
return content.includes('SELECT *')
87-
})
90+
.poll(
91+
async () => {
92+
const content = (await fs.readFile(modelPath)).toString('utf8')
93+
return content.includes('SELECT *')
94+
},
95+
{ timeout: 15_000 },
96+
)
8897
.toBeFalsy()
8998

9099
// Assert that the model no longer contains SELECT * but SELECT id, customer_id, waiter_id, start_ts, end_ts, event_date

0 commit comments

Comments
 (0)