@@ -1674,7 +1674,7 @@ Resources:
16741674 await client . closeDocument ( { textDocument : { uri } } ) ;
16751675 } ) ;
16761676
1677- it . todo ( 'should show optional properties after required ones fulfilled' , async ( ) => {
1677+ it ( 'should show optional properties after required ones fulfilled' , async ( ) => {
16781678 const template = getSimpleYamlTemplateText ( ) ;
16791679 const updatedTemplate = `AWSTemplateFormatVersion: '2010-09-09'
16801680Description: Lambda function ListBucketsCommand.
@@ -1696,7 +1696,7 @@ Resources:
16961696 return response.Buckets;
16971697 };
16981698 ` ;
1699- const uri = await client . openJsonTemplate ( template ) ;
1699+ const uri = await client . openYamlTemplate ( template ) ;
17001700
17011701 await client . changeDocument ( {
17021702 textDocument : { uri, version : 2 } ,
@@ -1712,9 +1712,30 @@ Resources:
17121712 expect ( completions ?. items ) . toBeDefined ( ) ;
17131713
17141714 const labels = completions . items . map ( ( item : any ) => item . label ) ;
1715- expect ( labels ) . toContain ( 'Architecture' ) ;
1716-
1717- // works in functional testing and json, failing in YAML
1715+ expect ( labels ) . toEqual ( [
1716+ 'Description' ,
1717+ 'TracingConfig' ,
1718+ 'VpcConfig' ,
1719+ 'RuntimeManagementConfig' ,
1720+ 'ReservedConcurrentExecutions' ,
1721+ 'SnapStart' ,
1722+ 'FileSystemConfigs' ,
1723+ 'FunctionName' ,
1724+ 'KmsKeyArn' ,
1725+ 'PackageType' ,
1726+ 'CodeSigningConfigArn' ,
1727+ 'Layers' ,
1728+ 'Tags' ,
1729+ 'ImageConfig' ,
1730+ 'MemorySize' ,
1731+ 'DeadLetterConfig' ,
1732+ 'Timeout' ,
1733+ 'LoggingConfig' ,
1734+ 'RecursiveLoop' ,
1735+ 'Environment' ,
1736+ 'EphemeralStorage' ,
1737+ 'Architectures' ,
1738+ ] ) ;
17181739
17191740 await client . closeDocument ( { textDocument : { uri } } ) ;
17201741 } ) ;
@@ -3519,7 +3540,7 @@ Resources:
35193540 } ) ;
35203541
35213542 describe ( 'Cross-Reference Completions' , ( ) => {
3522- it . todo ( 'should provide condition reference completions in resources' , async ( ) => {
3543+ it ( 'should provide condition reference completions in resources' , async ( ) => {
35233544 const template = getSimpleJsonTemplateText ( ) ;
35243545 const updatedTemplate = `{
35253546"AWSTemplateFormatVersion": "2010-09-09",
@@ -3558,10 +3579,6 @@ Resources:
35583579 const labels = completions . items . map ( ( item : any ) => item . label ) ;
35593580 expect ( labels ) . toContain ( 'CreateProdResources' ) ;
35603581
3561- // todo: condition are not provided as completions
3562- // although template validation throws error
3563- // '' is not one of ['CreateProdResources']
3564-
35653582 await client . closeDocument ( { textDocument : { uri } } ) ;
35663583 } ) ;
35673584 } ) ;
@@ -3787,8 +3804,29 @@ Resources:
37873804 expect ( completions ?. items ) . toBeDefined ( ) ;
37883805
37893806 const labels = completions . items . map ( ( item : any ) => item . label ) ;
3790- expect ( labels ) . toContain ( 'Description' ) ;
3791- expect ( labels ) . toContain ( 'Architectures' ) ;
3807+ expect ( labels ) . toEqual ( [
3808+ 'Description' ,
3809+ 'TracingConfig' ,
3810+ 'VpcConfig' ,
3811+ 'RuntimeManagementConfig' ,
3812+ 'ReservedConcurrentExecutions' ,
3813+ 'SnapStart' ,
3814+ 'FileSystemConfigs' ,
3815+ 'KmsKeyArn' ,
3816+ 'PackageType' ,
3817+ 'CodeSigningConfigArn' ,
3818+ 'Layers' ,
3819+ 'Tags' ,
3820+ 'ImageConfig' ,
3821+ 'MemorySize' ,
3822+ 'DeadLetterConfig' ,
3823+ 'Timeout' ,
3824+ 'LoggingConfig' ,
3825+ 'RecursiveLoop' ,
3826+ 'Environment' ,
3827+ 'EphemeralStorage' ,
3828+ 'Architectures' ,
3829+ ] ) ;
37923830
37933831 await client . closeDocument ( { textDocument : { uri } } ) ;
37943832 } ) ;
0 commit comments