@@ -34,6 +34,7 @@ describe('Config Tests', () => {
34
34
slack : {
35
35
channel : 'channel1' ,
36
36
workspace : 'workspace1' ,
37
+ invitedUserCount : 3 ,
37
38
} ,
38
39
alerts : [ {
39
40
type : '404' ,
@@ -55,6 +56,7 @@ describe('Config Tests', () => {
55
56
const config = Config ( data ) ;
56
57
expect ( config . slack . channel ) . to . equal ( 'channel1' ) ;
57
58
expect ( config . slack . workspace ) . to . equal ( 'workspace1' ) ;
59
+ expect ( config . slack . invitedUserCount ) . to . equal ( 3 ) ;
58
60
expect ( config . alerts [ 0 ] . mentions [ 0 ] . slack [ 0 ] ) . to . equal ( 'id1' ) ;
59
61
expect ( config . alerts [ 0 ] . byOrg ) . to . be . true ;
60
62
expect ( config . audits . auditsDisabled ( ) ) . to . be . false ;
@@ -67,6 +69,7 @@ describe('Config Tests', () => {
67
69
slack : {
68
70
channel : 'channel1' ,
69
71
workspace : 'workspace1' ,
72
+ invitedUserCount : 19 ,
70
73
} ,
71
74
alerts : [ {
72
75
type : '404' ,
@@ -78,6 +81,7 @@ describe('Config Tests', () => {
78
81
const config = Config ( data ) ;
79
82
expect ( config . slack . channel ) . to . equal ( 'channel1' ) ;
80
83
expect ( config . slack . workspace ) . to . equal ( 'workspace1' ) ;
84
+ expect ( config . slack . invitedUserCount ) . to . equal ( 19 ) ;
81
85
expect ( config . alerts [ 0 ] . mentions [ 0 ] . slack [ 0 ] ) . to . equal ( 'id1' ) ;
82
86
expect ( config . alerts [ 0 ] . byOrg ) . to . be . true ;
83
87
expect ( config . audits . auditsDisabled ( ) ) . to . be . false ;
@@ -97,6 +101,17 @@ describe('Config Tests', () => {
97
101
} ;
98
102
expect ( ( ) => Config ( data ) ) . to . throw ( 'Configuration validation error: "alerts[0].type" must be a string' ) ;
99
103
} ) ;
104
+
105
+ it ( 'throws an error when invitedUserCount is invalid' , ( ) => {
106
+ const data = {
107
+ slack : {
108
+ channel : 'channel1' ,
109
+ workspace : 'workspace1' ,
110
+ invitedUserCount : - 12 ,
111
+ } ,
112
+ } ;
113
+ expect ( ( ) => Config ( data ) ) . to . throw ( 'Configuration validation error: "slack.invitedUserCount" must be greater than or equal to 0' ) ;
114
+ } ) ;
100
115
} ) ;
101
116
102
117
describe ( 'fromDynamoItem Static Method' , ( ) => {
0 commit comments