File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/core/src/test/shared Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 33 * SPDX-License-Identifier: Apache-2.0
44 */
55import 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
811describe ( '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} )
You can’t perform that action at this time.
0 commit comments