Skip to content

Commit 9a72b73

Browse files
committed
add ui tests
1 parent 423ca0c commit 9a72b73

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/core/src/test/shared/remoteSession.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import assert from 'assert'
6-
import { minimumSsmActions } from '../../shared/remoteSession'
6+
import { minimumSsmActions, promptToAddInlinePolicy } from '../../shared/remoteSession'
7+
import { IamClient } from '../../shared/clients/iamClient'
8+
import { getTestWindow } from './vscode/window'
9+
import { cancel } from '../../shared'
710

811
describe('minimumSsmActions', function () {
912
it('should contain minimal actions needed for ssm connection', function () {
@@ -17,4 +20,13 @@ describe('minimumSsmActions', function () {
1720
'ssm:UpdateInstanceInformation',
1821
])
1922
})
23+
24+
it('prompts the user for confirmation before adding policies and allow cancels', async function () {
25+
getTestWindow().onDidShowMessage((message) => {
26+
assert.ok(message.message.includes('add'), 'should prompt to add policies')
27+
getTestWindow().getFirstMessage().selectItem(cancel)
28+
})
29+
const added = await promptToAddInlinePolicy({} as IamClient, 'roleArnTest')
30+
assert.ok(!added, 'should not add policies by default')
31+
})
2032
})

0 commit comments

Comments
 (0)