@@ -256,21 +256,23 @@ describe("createSynologyChatPlugin", () => {
256256 const plugin = createSynologyChatPlugin ( ) ;
257257 const account = makeSecurityAccount ( { token : "" } ) ;
258258 const warnings = plugin . security . collectWarnings ( { cfg : { } , account } ) ;
259- expect ( warnings . some ( ( w : string ) => w . includes ( "token" ) ) ) . toBe ( true ) ;
259+ expect ( warnings ) . toEqual ( expect . arrayContaining ( [ expect . stringContaining ( "token" ) ] ) ) ;
260260 } ) ;
261261
262262 it ( "warns when allowInsecureSsl is true" , ( ) => {
263263 const plugin = createSynologyChatPlugin ( ) ;
264264 const account = makeSecurityAccount ( { allowInsecureSsl : true } ) ;
265265 const warnings = plugin . security . collectWarnings ( { cfg : { } , account } ) ;
266- expect ( warnings . some ( ( w : string ) => w . includes ( "SSL" ) ) ) . toBe ( true ) ;
266+ expect ( warnings ) . toEqual ( expect . arrayContaining ( [ expect . stringContaining ( "SSL" ) ] ) ) ;
267267 } ) ;
268268
269269 it ( "warns when dangerous name matching is enabled" , ( ) => {
270270 const plugin = createSynologyChatPlugin ( ) ;
271271 const account = makeSecurityAccount ( { dangerouslyAllowNameMatching : true } ) ;
272272 const warnings = plugin . security . collectWarnings ( { cfg : { } , account } ) ;
273- expect ( warnings . some ( ( w : string ) => w . includes ( "dangerouslyAllowNameMatching" ) ) ) . toBe ( true ) ;
273+ expect ( warnings ) . toEqual (
274+ expect . arrayContaining ( [ expect . stringContaining ( "dangerouslyAllowNameMatching" ) ] ) ,
275+ ) ;
274276 } ) ;
275277
276278 it ( "warns when inherited shared webhookPath is dangerously re-enabled" , ( ) => {
@@ -281,39 +283,45 @@ describe("createSynologyChatPlugin", () => {
281283 dangerouslyAllowInheritedWebhookPath : true ,
282284 } ) ;
283285 const warnings = plugin . security . collectWarnings ( { cfg : { } , account } ) ;
284- expect (
285- warnings . some ( ( w : string ) => w . includes ( "dangerouslyAllowInheritedWebhookPath=true" ) ) ,
286- ) . toBe ( true ) ;
286+ expect ( warnings ) . toEqual (
287+ expect . arrayContaining ( [
288+ expect . stringContaining ( "dangerouslyAllowInheritedWebhookPath=true" ) ,
289+ ] ) ,
290+ ) ;
287291 } ) ;
288292
289293 it ( "warns when dmPolicy is open" , ( ) => {
290294 const plugin = createSynologyChatPlugin ( ) ;
291295 const account = makeSecurityAccount ( { dmPolicy : "open" , allowedUserIds : [ "*" ] } ) ;
292296 const warnings = plugin . security . collectWarnings ( { cfg : { } , account } ) ;
293- expect ( warnings . some ( ( w : string ) => w . includes ( "open" ) ) ) . toBe ( true ) ;
297+ expect ( warnings ) . toEqual ( expect . arrayContaining ( [ expect . stringContaining ( "open" ) ] ) ) ;
294298 } ) ;
295299
296300 it ( "warns when dmPolicy is open and allowedUserIds is empty" , ( ) => {
297301 const plugin = createSynologyChatPlugin ( ) ;
298302 const account = makeSecurityAccount ( { dmPolicy : "open" , allowedUserIds : [ ] } ) ;
299303 const warnings = plugin . security . collectWarnings ( { cfg : { } , account } ) ;
300- expect ( warnings . some ( ( w : string ) => w . includes ( "empty allowedUserIds" ) ) ) . toBe ( true ) ;
304+ expect ( warnings ) . toEqual (
305+ expect . arrayContaining ( [ expect . stringContaining ( "empty allowedUserIds" ) ] ) ,
306+ ) ;
301307 } ) ;
302308
303309 it ( "warns when dmPolicy is allowlist and allowedUserIds is empty" , ( ) => {
304310 const plugin = createSynologyChatPlugin ( ) ;
305311 const account = makeSecurityAccount ( ) ;
306312 const warnings = plugin . security . collectWarnings ( { cfg : { } , account } ) ;
307- expect ( warnings . some ( ( w : string ) => w . includes ( "empty allowedUserIds" ) ) ) . toBe ( true ) ;
313+ expect ( warnings ) . toEqual (
314+ expect . arrayContaining ( [ expect . stringContaining ( "empty allowedUserIds" ) ] ) ,
315+ ) ;
308316 } ) ;
309317
310318 it ( "warns when named multi-account routes inherit a shared webhookPath" , ( ) => {
311319 const plugin = createSynologyChatPlugin ( ) ;
312320 const cfg = makeSharedWebhookConfig ( ) ;
313321 const account = plugin . config . resolveAccount ( cfg , "alerts" ) ;
314322 const warnings = plugin . security . collectWarnings ( { cfg, account } ) ;
315- expect ( warnings . some ( ( w : string ) => w . includes ( "must set an explicit webhookPath" ) ) ) . toBe (
316- true ,
323+ expect ( warnings ) . toEqual (
324+ expect . arrayContaining ( [ expect . stringContaining ( "must set an explicit webhookPath" ) ] ) ,
317325 ) ;
318326 } ) ;
319327
@@ -334,7 +342,9 @@ describe("createSynologyChatPlugin", () => {
334342 } ;
335343 const account = plugin . config . resolveAccount ( cfg , "alerts" ) ;
336344 const warnings = plugin . security . collectWarnings ( { cfg, account } ) ;
337- expect ( warnings . some ( ( w : string ) => w . includes ( "conflicts on webhookPath" ) ) ) . toBe ( true ) ;
345+ expect ( warnings ) . toEqual (
346+ expect . arrayContaining ( [ expect . stringContaining ( "conflicts on webhookPath" ) ] ) ,
347+ ) ;
338348 } ) ;
339349
340350 it ( "returns no warnings for fully configured account" , ( ) => {
0 commit comments