Skip to content

Commit

Permalink
add basic workspace trust unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten committed Mar 3, 2021
1 parent 17f63a6 commit e9533c2
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

import * as assert from 'assert';
import { URI } from 'vs/base/common/uri';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { IWorkspaceTrustService, workspaceTrustStateToString } from 'vs/platform/workspace/common/workspaceTrust';
import { getWorkspaceIdentifier, getSingleFolderWorkspaceIdentifier } from 'vs/workbench/services/workspaces/browser/workspaces';
import { WorkspaceTrustService } from 'vs/workbench/services/workspaces/common/workspaceTrust';
import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices';

suite('Workspaces', () => {
test('workspace identifiers are stable', function () {
Expand All @@ -17,3 +21,19 @@ suite('Workspaces', () => {
assert.strictEqual(getSingleFolderWorkspaceIdentifier(URI.parse('vscode-remote:/hello/test'))?.id, '474434e4');
});
});

suite('Workspace Trust', () => {
let workspaceTrustService: IWorkspaceTrustService;
setup(() => {
const instantiationService: TestInstantiationService = <TestInstantiationService>workbenchInstantiationService();
workspaceTrustService = instantiationService.createInstance(WorkspaceTrustService);
});

teardown(() => {

});

test('Sample Test', function () {
assert.strictEqual(workspaceTrustStateToString(workspaceTrustService.getWorkspaceTrustState()), 'Trusted');
});
});

0 comments on commit e9533c2

Please sign in to comment.