25 lines
898 B
JavaScript
25 lines
898 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
import test from 'node:test';
|
|
import { en } from '../ui/locales/en.js';
|
|
|
|
const html = readFileSync(new URL('../ui/index.html', import.meta.url), 'utf8');
|
|
|
|
test('every launcher text resolves to a nonempty English translation', () => {
|
|
for (const [, key] of html.matchAll(/data-i18n="([^"]+)"/g)) {
|
|
assert.equal(typeof en[key], 'string', key);
|
|
assert.ok(en[key].trim(), key);
|
|
}
|
|
});
|
|
|
|
test('the launcher opens only the configured HTTPS workspace without an IPC bridge', () => {
|
|
const links = [...html.matchAll(/<a\s[^>]*href="([^"]+)"/g)];
|
|
assert.equal(links.length, 1);
|
|
assert.equal(links[0][1], 'https://kanbangit.de/');
|
|
const main = readFileSync(
|
|
new URL('../ui/main.js', import.meta.url),
|
|
'utf8',
|
|
);
|
|
assert.doesNotMatch(main, /__TAURI__|invoke\(/);
|
|
});
|