Initial commit: update2
This commit is contained in:
25
hmi-frontend/tests/futuristic-v54.mjs
Normal file
25
hmi-frontend/tests/futuristic-v54.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
import {readFileSync} from 'node:fs';
|
||||
import {resolve} from 'node:path';
|
||||
import assert from 'node:assert/strict';
|
||||
const src=f=>readFileSync(resolve(process.cwd(),f),'utf8');
|
||||
const catalog=src('src/widgets/catalog.ts');
|
||||
const allowlist=src('../backend/src/main/java/com/workbenchclassic/hmi/HmiApiResource.java');
|
||||
const renderer=src('src/widgets/WidgetRenderer.vue');
|
||||
const preset=src('src/widgets/presets.ts');
|
||||
const app=src('src/App.vue');
|
||||
const css=src('src/workbench-futuristic.css');
|
||||
const component=src('src/components/CurvedWorkbenchHeader.vue');
|
||||
for(const t of ['ui.curved-header','ui.neon-actions','ui.metal-panel']){
|
||||
assert.ok(catalog.includes(`type:'${t}'`),`${t} catalog`);
|
||||
assert.ok(allowlist.includes(`"${t}"`),`${t} Java allowlist`);
|
||||
assert.ok(renderer.includes(`widget.type==='${t}'`),`${t} renderer`);
|
||||
}
|
||||
assert.ok(app.includes("activeTheme==='neon'"),'global header only in neon');
|
||||
assert.ok(app.includes('ios'),'existing ios theme');
|
||||
assert.ok(preset.includes('neon-industrial'),'new preset');
|
||||
assert.ok(css.includes('prefers-reduced-motion'),'reduced-motion');
|
||||
assert.ok(css.includes(':focus-visible'),'visible keyboard focus');
|
||||
assert.ok(component.includes('<svg')&&component.includes('preserveAspectRatio="none"'),'scalable SVG header');
|
||||
assert.ok(src('src/widgets/NeonActionsWidget.vue').includes('FuturisticButton'),'uses shared button');
|
||||
assert.ok(!src('src/widgets/NeonActionsWidget.vue').includes('fetch('),'button widgets do not start REST requests');
|
||||
console.log('V5.4 futuristic theme registration checks: OK');
|
||||
21
hmi-frontend/tests/neon-theme.mjs
Normal file
21
hmi-frontend/tests/neon-theme.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
const dir=path.dirname(fileURLToPath(import.meta.url));
|
||||
const root=path.resolve(dir,'..');
|
||||
const read=p=>fs.readFileSync(path.join(root,p),'utf8');
|
||||
const app=read('src/App.vue'),types=read('src/types.ts'),main=read('src/main.ts'),css=read('src/workbench-neon.css'),server=read('../backend/src/main/java/com/workbenchclassic/hmi/HmiApiResource.java'),presets=read('src/widgets/presets.ts');
|
||||
assert.match(types, /'ios'\|'dark'\|'light'\|'system'\|'neon'/);
|
||||
assert.match(app, /chooseTheme\(/);
|
||||
assert.match(app, /value="neon">Workbench Neon/);
|
||||
assert.match(app, /@click="savePreferences"/);
|
||||
assert.match(app, /document\.body\.dataset\.hmiTheme=value/);
|
||||
assert.match(css, /\.shell\.neon\s*\{/);
|
||||
assert.match(css, /body\[data-hmi-theme='neon'\] \.wb-mes-dialog/);
|
||||
assert.match(css, /prefers-reduced-motion:reduce/);
|
||||
assert.match(main, /workbench-neon\.css/);
|
||||
assert.match(server, /!s\.equals\("neon"\)/);
|
||||
assert.match(presets, /neon-production/);
|
||||
assert.ok(fs.existsSync(path.join(root,'../hmi-examples/Workbench_Neon_Designvorschau.html')));
|
||||
console.log('Workbench Neon: 11 Theme-/Backend-/Preset-Prüfungen erfolgreich');
|
||||
Reference in New Issue
Block a user