Skip to content

chore(vscode): add test for quickfix#4958

Merged
benfdking merged 1 commit intomainfrom
adding_quicfix_test
Jul 24, 2025
Merged

chore(vscode): add test for quickfix#4958
benfdking merged 1 commit intomainfrom
adding_quicfix_test

Conversation

@benfdking
Copy link
Contributor

  • also refactored the openProblemsView

@benfdking benfdking requested a review from Copilot July 11, 2025 21:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new end-to-end test for the “noselectstar” quickfix and centralizes opening the Problems panel via a shared helper.

  • Introduce openProblemsView utility in utils.ts
  • Replace inline runCommand(page, 'View: Focus Problems') calls with openProblemsView across tests
  • Add quickfix.spec.ts to validate the quickfix replaces SELECT * with explicit columns

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
vscode/extension/tests/utils.ts Added openProblemsView helper with JSDoc
vscode/extension/tests/quickfix.spec.ts New test for the noselectstar quickfix
vscode/extension/tests/diagnostics.spec.ts Swapped runCommand for openProblemsView
vscode/extension/tests/broken_project.spec.ts Replaced a single runCommand call with openProblemsView
Comments suppressed due to low confidence (1)

vscode/extension/tests/utils.ts:89

  • [nitpick] The JSDoc for openProblemsView is missing a @param annotation for page; adding parameter documentation improves clarity for users of this helper.
/**

.first()
.click()

await page.waitForTimeout(1_000)
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using a fixed timeout for waiting; prefer waiting on a specific condition (e.g., expect.poll or waitForFunction) to detect when the file has been updated.

Suggested change
await page.waitForTimeout(1_000)
await page.waitForFunction(async () => {
const content = await fs.readFile(modelPath, 'utf8');
return content.includes('SELECT id, customer_id, waiter_id, start_ts, end_ts, event_date') && !content.includes('SELECT *');
});

Copilot uses AI. Check for mistakes.
Comment on lines +74 to +76
const readUpdatedFile = await fs.readFile(modelPath)
expect(readUpdatedFile.toString()).not.toContain('SELECT *')
expect(readUpdatedFile.toString()).toContain(
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The file is read and converted to string multiple times for assertions; consider reading once and storing the string in a variable to simplify and clarify the checks.

Suggested change
const readUpdatedFile = await fs.readFile(modelPath)
expect(readUpdatedFile.toString()).not.toContain('SELECT *')
expect(readUpdatedFile.toString()).toContain(
const readUpdatedFile = (await fs.readFile(modelPath)).toString()
expect(readUpdatedFile).not.toContain('SELECT *')
expect(readUpdatedFile).toContain(

Copilot uses AI. Check for mistakes.
@benfdking benfdking force-pushed the adding_quicfix_test branch from 7a9e20c to b0aad03 Compare July 23, 2025 21:15
@benfdking benfdking force-pushed the adding_quicfix_test branch from b0aad03 to 7fd1a44 Compare July 24, 2025 08:58
@benfdking benfdking merged commit afb7907 into main Jul 24, 2025
26 checks passed
@benfdking benfdking deleted the adding_quicfix_test branch July 24, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants