import { CspConfig } from '.' ; describe ( 'CspConfig' , ( ) => { test ( 'DEFAULT' , ( ) => { expect ( CspConfig . DEFAULT ) . toMatchInlineSnapshot ( `
      CspConfig {
        "header": "script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'",
        "rules": Array [
          "script-src 'unsafe-eval' 'self'",
          "worker-src blob: 'self'",
          "style-src 'unsafe-inline' 'self'",
        ],
        "strict": false,
        "warnLegacyBrowsers": true,
      }
    ` ) ; } ) ; test ( 'defaults from config' , ( ) => { expect ( new CspConfig ( ) ) . toMatchInlineSnapshot ( `
      CspConfig {
        "header": "script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'",
        "rules": Array [
          "script-src 'unsafe-eval' 'self'",
          "worker-src blob: 'self'",
          "style-src 'unsafe-inline' 'self'",
        ],
        "strict": false,
        "warnLegacyBrowsers": true,
      }
    ` ) ; } ) ; test ( 'creates from partial config' , ( ) => { expect ( new CspConfig ( { strict : true , warnLegacyBrowsers : false } ) ) . toMatchInlineSnapshot ( `
      CspConfig {
        "header": "script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'",
        "rules": Array [
          "script-src 'unsafe-eval' 'self'",
          "worker-src blob: 'self'",
          "style-src 'unsafe-inline' 'self'",
        ],
        "strict": true,
        "warnLegacyBrowsers": false,
      }
    ` ) ; } ) ; test ( 'computes header from rules' , ( ) => { const cspConfig = new CspConfig ( { rules : [ 'alpha' , 'beta' , 'gamma' ] } ) ; expect ( cspConfig ) . toMatchInlineSnapshot ( `
      CspConfig {
        "header": "alpha; beta; gamma",
        "rules": Array [
          "alpha",
          "beta",
          "gamma",
        ],
        "strict": false,
        "warnLegacyBrowsers": true,
      }
    ` ) ; } ) ; } ) ;