Skip to content

Commit 272c601

Browse files
Copiloteleanorjboyd
andcommitted
Convert pytest installation prompt to modal dialog
Co-authored-by: eleanorjboyd <[email protected]>
1 parent ac4cc4a commit 272c601

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/client/testing/configuration/pytestInstallationHelper.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ export class PytestInstallationHelper {
2424
const installOption = l10n.t('Install pytest');
2525
const ignoreOption = l10n.t('Ignore');
2626

27-
const selection = await this.appShell.showInformationMessage(message, installOption, ignoreOption);
27+
const selection = await this.appShell.showInformationMessage(
28+
message,
29+
{ modal: true },
30+
installOption,
31+
ignoreOption,
32+
);
2833

2934
if (selection === installOption) {
3035
return this.installPytest(workspaceUri);

src/test/testing/configuration/pytestInstallationHelper.unit.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ suite('PytestInstallationHelper', () => {
3333

3434
test('promptToInstallPytest should return false if user selects ignore', async () => {
3535
appShell
36-
.setup((a) => a.showInformationMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
36+
.setup((a) => a.showInformationMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
3737
.returns(() => Promise.resolve('Ignore'))
3838
.verifiable(TypeMoq.Times.once());
3939

@@ -45,7 +45,7 @@ suite('PytestInstallationHelper', () => {
4545

4646
test('promptToInstallPytest should return false if user cancels', async () => {
4747
appShell
48-
.setup((a) => a.showInformationMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
48+
.setup((a) => a.showInformationMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
4949
.returns(() => Promise.resolve(undefined))
5050
.verifiable(TypeMoq.Times.once());
5151

@@ -68,7 +68,7 @@ suite('PytestInstallationHelper', () => {
6868
useEnvExtensionStub.returns(false);
6969

7070
appShell
71-
.setup((a) => a.showInformationMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
71+
.setup((a) => a.showInformationMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
7272
.returns(() => Promise.resolve('Install pytest'))
7373
.verifiable(TypeMoq.Times.once());
7474

@@ -95,6 +95,7 @@ suite('PytestInstallationHelper', () => {
9595
TypeMoq.It.is((msg: string) => msg.includes('pytest selected but not installed')),
9696
TypeMoq.It.isAny(),
9797
TypeMoq.It.isAny(),
98+
TypeMoq.It.isAny(),
9899
),
99100
)
100101
.returns(() => Promise.resolve('Install pytest'))

0 commit comments

Comments
 (0)