Repository navigation
Add tests for Open Referenced File command - #4623
Open
syedataiba12311-coder wants to merge 3 commits into
Open
syedataiba12311-coder wants to merge 3 commits into
syedataiba12311-coder wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The Windows-specific path contract remains unverified because the test uses only a POSIX fixture, allowing an incorrect use of Uri.path to pass on Linux.
1 open issue
What changed in this PR
Adds focused VS Code integration coverage for the existing CodeQL: Open Referenced File command, verifying .qlref resolution and opening the resolved query without preview mode.
Changes:
- Adds a test verifying the selected URI's
fsPathis passed toresolveQlref. - Verifies the resolved
.qlfile opens with{ preview: false }. - Adds setup and cleanup for mocked VS Code APIs.
| File | Description |
|---|---|
| extensions/ql-vscode/test/vscode-tests/no-workspace/language-support/query-editor.test.ts | Adds focused command-level test coverage for resolving and opening a referenced query file. |
Review effort: Lite (adaptive)
| }); | ||
|
|
||
| it("resolves a qlref and opens the referenced query", async () => { | ||
| const selectedQuery = Uri.file("/tmp/reference.qlref"); |
There was a problem hiding this comment.
Thanks for the feedback. I've updated the test to use a Windows drive-letter URI when running on Windows, while retaining the POSIX fixture on other platforms. The assertion continues to verify selectedQuery.fsPath. The fix is pushed in commit f37dd0c. Could you please review the update?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds focused coverage for the
CodeQL: Open Referenced Filecommand.The test verifies that the command:
.qlreffile'sfsPathtoresolveQlref, preserving the Windows path behavior fixed in Fix the "CodeQL: Open Referenced File" command for windows paths #979;.qlfile; andCloses #980.
Testing
This PR is opened as a draft for repository CI validation. The change only adds a VS Code test and does not modify production code.