mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-23 13:20:30 -04:00
Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)
This commit is contained in:
@@ -7,9 +7,9 @@ import * as assert from 'assert';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { INotificationService, IPromptChoice, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { INotificationService, IPromptChoice, Severity, IPromptOptions } from 'vs/platform/notification/common/notification';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { ExperimentalPrompts } from 'vs/workbench/contrib/experiments/electron-browser/experimentalPrompt';
|
||||
@@ -59,11 +59,11 @@ suite('Experimental Prompts', () => {
|
||||
|
||||
setup(() => {
|
||||
storageData = {};
|
||||
instantiationService.stub(IStorageService, {
|
||||
get: (a, b, c) => a === 'experiments.experiment1' ? JSON.stringify(storageData) : c,
|
||||
instantiationService.stub(IStorageService, <Partial<IStorageService>>{
|
||||
get: (a: string, b: StorageScope, c?: string) => a === 'experiments.experiment1' ? JSON.stringify(storageData) : c,
|
||||
store: (a, b, c) => {
|
||||
if (a === 'experiments.experiment1') {
|
||||
storageData = JSON.parse(b);
|
||||
storageData = JSON.parse(b + '');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -91,7 +91,7 @@ suite('Experimental Prompts', () => {
|
||||
};
|
||||
|
||||
instantiationService.stub(INotificationService, {
|
||||
prompt: (a: Severity, b: string, c: IPromptChoice[], options) => {
|
||||
prompt: (a: Severity, b: string, c: IPromptChoice[], options: IPromptOptions) => {
|
||||
assert.equal(b, promptText);
|
||||
assert.equal(c.length, 2);
|
||||
c[0].run();
|
||||
@@ -116,7 +116,7 @@ suite('Experimental Prompts', () => {
|
||||
};
|
||||
|
||||
instantiationService.stub(INotificationService, {
|
||||
prompt: (a: Severity, b: string, c: IPromptChoice[], options) => {
|
||||
prompt: (a: Severity, b: string, c: IPromptChoice[]) => {
|
||||
assert.equal(b, promptText);
|
||||
assert.equal(c.length, 2);
|
||||
c[1].run();
|
||||
@@ -141,10 +141,10 @@ suite('Experimental Prompts', () => {
|
||||
};
|
||||
|
||||
instantiationService.stub(INotificationService, {
|
||||
prompt: (a: Severity, b: string, c: IPromptChoice[], options) => {
|
||||
prompt: (a: Severity, b: string, c: IPromptChoice[], options: IPromptOptions) => {
|
||||
assert.equal(b, promptText);
|
||||
assert.equal(c.length, 2);
|
||||
options.onCancel();
|
||||
options.onCancel!();
|
||||
return undefined!;
|
||||
}
|
||||
});
|
||||
@@ -194,4 +194,4 @@ suite('Experimental Prompts', () => {
|
||||
assert.equal(ExperimentalPrompts.getLocalizedText(englishUSTextCase.promptText, 'fr'), englishUSTextCase.promptText['en-us']);
|
||||
assert.equal(!!ExperimentalPrompts.getLocalizedText(noEnglishTextCase.promptText, 'fr'), false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user