import * as osdTestServer from '../../../test_helpers/osd_server' ; import { Root } from '../../root' ; describe ( 'Platform assets' , function ( ) { let root ; beforeAll ( async function ( ) { root = osdTestServer . createRoot ( { plugins : { initialize : false } } ) ; await root . setup ( ) ; await root . start ( ) ; } ) ; afterAll ( async function ( ) { await root . shutdown ( ) ; } ) ; it ( 'exposes static assets' , async ( ) => { await osdTestServer . request . get ( root , '/ui/favicons/favicon.ico' ) . expect ( 200 ) ; } ) ; it ( 'returns 404 if not found' , async function ( ) { await osdTestServer . request . get ( root , '/ui/favicons/not-a-favicon.ico' ) . expect ( 404 ) ; } ) ; it ( 'does not expose folder content' , async function ( ) { await osdTestServer . request . get ( root , '/ui/favicons/' ) . expect ( 403 ) ; } ) ; it ( 'does not allow file tree traversing' , async function ( ) { await osdTestServer . request . get ( root , '/ui/../../../../../README.md' ) . expect ( 404 ) ; } ) ; } ) ;