Skip to content

Commit 0ab39f4

Browse files
committed
Fix microsoft#71801, avoid calling window.open from a test
1 parent ef77b51 commit 0ab39f4

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as assert from 'assert';
77
import { Emitter } from 'vs/base/common/event';
88
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
99
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
10-
import { INotificationService, IPromptChoice, Severity, IPromptOptions } from 'vs/platform/notification/common/notification';
10+
import { INotificationService, IPromptChoice, IPromptOptions, Severity } from 'vs/platform/notification/common/notification';
1111
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
1212
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
1313
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -37,7 +37,6 @@ suite('Experimental Prompts', () => {
3737
commands: [
3838
{
3939
text: 'Yes',
40-
externalLink: 'https://code.visualstudio.com'
4140
},
4241
{
4342
text: 'No'
@@ -83,30 +82,30 @@ suite('Experimental Prompts', () => {
8382
});
8483

8584

86-
// test('Show experimental prompt if experiment should be run. Choosing option with link should mark experiment as complete', () => {
85+
test('Show experimental prompt if experiment should be run. Choosing option with link should mark experiment as complete', () => {
8786

88-
// storageData = {
89-
// enabled: true,
90-
// state: ExperimentState.Run
91-
// };
87+
storageData = {
88+
enabled: true,
89+
state: ExperimentState.Run
90+
};
9291

93-
// instantiationService.stub(INotificationService, {
94-
// prompt: (a: Severity, b: string, c: IPromptChoice[], options: IPromptOptions) => {
95-
// assert.equal(b, promptText);
96-
// assert.equal(c.length, 2);
97-
// c[0].run();
98-
// return undefined!;
99-
// }
100-
// });
92+
instantiationService.stub(INotificationService, {
93+
prompt: (a: Severity, b: string, c: IPromptChoice[], options: IPromptOptions) => {
94+
assert.equal(b, promptText);
95+
assert.equal(c.length, 2);
96+
c[0].run();
97+
return undefined!;
98+
}
99+
});
101100

102-
// experimentalPrompt = instantiationService.createInstance(ExperimentalPrompts);
103-
// onExperimentEnabledEvent.fire(experiment);
101+
experimentalPrompt = instantiationService.createInstance(ExperimentalPrompts);
102+
onExperimentEnabledEvent.fire(experiment);
104103

105-
// return Promise.resolve(null).then(result => {
106-
// assert.equal(storageData['state'], ExperimentState.Complete);
107-
// });
104+
return Promise.resolve(null).then(result => {
105+
assert.equal(storageData['state'], ExperimentState.Complete);
106+
});
108107

109-
// });
108+
});
110109

111110
test('Show experimental prompt if experiment should be run. Choosing negative option should mark experiment as complete', () => {
112111

0 commit comments

Comments
 (0)