HH-531: remove CSP-blocked draggable shim (#122)
Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -27,3 +27,13 @@ assert.ok(
|
||||
);
|
||||
assert.ok(!/<script(?![^>]*\bsrc=)[^>]*>/i.test(html), 'inline script found');
|
||||
assets.forEach(asset => assert.ok(existsSync(dist + asset.slice(1)), asset));
|
||||
|
||||
const dashboard = assets
|
||||
.filter(asset => asset.endsWith('.js'))
|
||||
.map(asset => readFileSync(dist + asset.slice(1), 'utf8'))
|
||||
.join('\n');
|
||||
assert.doesNotMatch(
|
||||
dashboard,
|
||||
/=\(?function\(\)\{return this\}\)?\(\);try\{([A-Za-z_$][\w$]*)=\1\|\|new Function\("return this"\)\(\)/,
|
||||
'dashboard contains a CSP-blocked UMD global shim'
|
||||
);
|
||||
|
||||
@@ -44,6 +44,10 @@ const resolveAliases = {
|
||||
survey: path.resolve(__dirname, './app/javascript/survey'),
|
||||
widget: path.resolve(__dirname, './app/javascript/widget'),
|
||||
assets: path.resolve(__dirname, './app/javascript/dashboard/assets'),
|
||||
vuedraggable: path.resolve(
|
||||
__dirname,
|
||||
'./node_modules/vuedraggable/src/vuedraggable.js'
|
||||
),
|
||||
'@material/mwc-icon': path.resolve(
|
||||
__dirname,
|
||||
'./app/javascript/shared/components/MaterialIconElement.js'
|
||||
|
||||
Reference in New Issue
Block a user