@@ -10,7 +10,7 @@ describe('PCI Data Security Standard: 3.2.1', () => {
1010 rulesEngine = initRuleEngine ( 'aws' , 'PCI' )
1111 } )
1212 describe ( 'Autoscaling Check 1: Auto Scaling groups associated with a load balancer should use health checks' , ( ) => {
13- test ( 'Should fail when it contains an invalid health check type and zero load balancers' , async ( ) => {
13+ test ( 'Should pass when it contains an invalid health check type and zero load balancers' , async ( ) => {
1414 const data = {
1515 queryawsAsg : [
1616 {
@@ -26,10 +26,29 @@ describe('PCI Data Security Standard: 3.2.1', () => {
2626 { ...data } as any
2727 )
2828
29+ expect ( processedRule . result ) . toBe ( Result . PASS )
30+ } )
31+
32+ test ( 'Should fail when it contains an invalid health check type and at least one load balancer' , async ( ) => {
33+ const data = {
34+ queryawsAsg : [
35+ {
36+ id : cuid ( ) ,
37+ loadBalancerNames : [ 'alb_1' , 'alb2' ] ,
38+ healthCheckType : 'EC2' ,
39+ } ,
40+ ] ,
41+ }
42+
43+ const [ processedRule ] = await rulesEngine . processRule (
44+ Aws_PCI_DSS_321_Autoscaling_1 as Rule ,
45+ { ...data } as any
46+ )
47+
2948 expect ( processedRule . result ) . toBe ( Result . FAIL )
3049 } )
3150
32- test ( 'Should fail when it contains a valid health check type and zero load balancers' , async ( ) => {
51+ test ( 'Should pass when it contains a valid health check type and zero load balancers' , async ( ) => {
3352 const data = {
3453 queryawsAsg : [
3554 {
@@ -45,7 +64,7 @@ describe('PCI Data Security Standard: 3.2.1', () => {
4564 { ...data } as any
4665 )
4766
48- expect ( processedRule . result ) . toBe ( Result . FAIL )
67+ expect ( processedRule . result ) . toBe ( Result . PASS )
4968 } )
5069
5170 test ( 'Should pass when it contains a valid health check type and at least one load balancer' , async ( ) => {
0 commit comments