Skip to content

Commit 04152e4

Browse files
committed
updated tests
1 parent de12d4b commit 04152e4

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

test/integrationTests/workspaceSymbolProvider.integration.tests.ts renamed to test/integrationTests/workspaceSymbolProvider.integration.test.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const chai = require('chai');
1313
chai.use(require('chai-arrays'));
1414
chai.use(require('chai-fs'));
1515

16-
suite(`DocumentSymbolProvider: ${testAssetWorkspace.description}`, function () {
16+
suite(`WorkspaceSymbolProvider: ${testAssetWorkspace.description}`, function () {
1717

1818
suiteSetup(async function () {
1919
should();
@@ -32,11 +32,27 @@ suite(`DocumentSymbolProvider: ${testAssetWorkspace.description}`, function () {
3232
});
3333

3434
test("Returns elements", async function () {
35-
let symbols = await GetWorkspaceSymbols();
35+
let symbols = await GetWorkspaceSymbols("P");
36+
expect(symbols.length).to.be.greaterThan(0);
37+
});
38+
39+
test("Returns no elements when minimum filter length is configured and search term is shorter", async function () {
40+
let omnisharpConfig = vscode.workspace.getConfiguration('omnisharp');
41+
await omnisharpConfig.update('minFindSymbolsFilterLength', 2);
42+
43+
let symbols = await GetWorkspaceSymbols("P");
44+
expect(symbols.length).to.be.equal(0);
45+
});
46+
47+
test("Returns elements when minimum filter length is configured and search term is longer or equal", async function () {
48+
let omnisharpConfig = vscode.workspace.getConfiguration('omnisharp');
49+
await omnisharpConfig.update('minFindSymbolsFilterLength', 2);
50+
51+
let symbols = await GetWorkspaceSymbols("P1");
3652
expect(symbols.length).to.be.greaterThan(0);
3753
});
3854
});
3955

40-
async function GetWorkspaceSymbols() {
41-
return <vscode.SymbolInformation[]>await vscode.commands.executeCommand("vscode.executeWorkspaceSymbolProvider");
56+
async function GetWorkspaceSymbols(filter: string) {
57+
return <vscode.SymbolInformation[]>await vscode.commands.executeCommand("vscode.executeWorkspaceSymbolProvider", filter);
4258
}

0 commit comments

Comments
 (0)