Skip to content

Commit 1080064

Browse files
committed
Move clipboard test to use prompt, not confirm
1 parent bef5224 commit 1080064

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/vs/platform/dialogs/test/common/testDialogService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export class TestDialogService implements IDialogService {
1414
readonly onWillShowDialog = Event.None;
1515
readonly onDidShowDialog = Event.None;
1616

17-
constructor(private defaultConfirmResult: IConfirmationResult | undefined = undefined) { }
17+
constructor(
18+
private defaultConfirmResult: IConfirmationResult | undefined = undefined,
19+
private defaultPromptResult: IPromptResult<any> | undefined = undefined
20+
) { }
1821

1922
private confirmResult: IConfirmationResult | undefined = undefined;
2023
setConfirmResult(result: IConfirmationResult) {
@@ -36,6 +39,9 @@ export class TestDialogService implements IDialogService {
3639
prompt<T>(prompt: IPromptWithDefaultCancel<T>): Promise<IPromptResult<T>>;
3740
prompt<T>(prompt: IPrompt<T>): Promise<IPromptResult<T>>;
3841
async prompt<T>(prompt: IPrompt<T> | IPromptWithCustomCancel<T>): Promise<IPromptResult<T> | IPromptResultWithCancel<T>> {
42+
if (this.defaultPromptResult) {
43+
return this.defaultPromptResult;
44+
}
3945
const promptButtons: IPromptBaseButton<T>[] = [...(prompt.buttons ?? [])];
4046
if (prompt.cancelButton && typeof prompt.cancelButton !== 'string' && typeof prompt.cancelButton !== 'boolean') {
4147
promptButtons.push(prompt.cancelButton);

src/vs/workbench/contrib/terminal/test/common/terminalClipboard.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ suite('TerminalClipboard', function () {
2525
configurationService = new TestConfigurationService({
2626
[TerminalSettingId.EnableMultiLinePasteWarning]: 'auto'
2727
});
28-
dialogService = new TestDialogService({ confirmed: false });
28+
dialogService = new TestDialogService(undefined, { result: { confirmed: false } });
2929

3030
instantiationService.stub(IConfigurationService, configurationService);
3131
instantiationService.stub(IDialogService, dialogService);

0 commit comments

Comments
 (0)