Initial commit: update3
This commit is contained in:
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