1- const defaults = require ( "../../js/defaults" ) ;
21const helpers = require ( "./helpers/global-setup" ) ;
32
43describe ( "config with variables and secrets" , ( ) => {
@@ -14,18 +13,22 @@ describe("config with variables and secrets", () => {
1413 expect ( config . language ) . toBe ( "de" ) ;
1514 } ) ;
1615
17- it ( "config.loglevel should be default " , async ( ) => {
18- expect ( config . logLevel ) . toStrictEqual ( defaults . logLevel ) ;
16+ it ( "config.loglevel should be [\"ERROR\", \"LOG\", \"WARN\", \"INFO\"] " , async ( ) => {
17+ expect ( config . logLevel ) . toStrictEqual ( [ "ERROR" , "LOG" , "WARN" , "INFO" ] ) ;
1918 } ) ;
2019
21- it ( "config.ipWhitelist should be default" , async ( ) => {
22- expect ( config . ipWhitelist ) . toStrictEqual ( defaults . ipWhitelist ) ;
20+ it ( "config.ipWhitelist should be [\"::ffff:127.0.0.1\", \"::1\", \"127.0.0.1\"]" , async ( ) => {
21+ expect ( config . ipWhitelist ) . toStrictEqual ( [ "::ffff:127.0.0.1" , "::1" , "127.0.0.1" ] ) ;
22+ } ) ;
23+
24+ it ( "config.timeFormat should be 12" , async ( ) => {
25+ expect ( config . timeFormat ) . toBe ( 12 ) ; // default is 24
2326 } ) ;
2427
2528 it ( "/config endpoint should show redacted secrets" , async ( ) => {
2629 const res = await fetch ( `http://localhost:${ config . port } /config` ) ;
2730 expect ( res . status ) . toBe ( 200 ) ;
2831 const cfg = await res . json ( ) ;
29- expect ( cfg . ipWhitelist ) . toStrictEqual ( [ "**SECRET_IP1 **" , "**SECRET_IP2 **" , "::**SECRET_IP3 **" ] ) ;
32+ expect ( cfg . ipWhitelist ) . toStrictEqual ( [ "**SECRET_IP2 **" , "::**SECRET_IP3 **" , "**SECRET_IP1 **" ] ) ;
3033 } ) ;
3134} ) ;
0 commit comments