6aedf21bf6
9676bb0 core: update-check is token-free (running vs vendored cms/core version) 59fb691 core: System panel fix + settings (update-check, self-service password, admins) 67bcb6a docs: HANDOVER — kgva LIVE on core (Variant A, in-place CT130); both sites on core git-subtree-dir: cms/core git-subtree-split: 9676bb0264a7caf254ccbc461bc803a6b3583127
32 lines
1.5 KiB
JavaScript
32 lines
1.5 KiB
JavaScript
import { test } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
process.env.CMS_CONFIG ||= fileURLToPath(new URL('../../examples/openbureau.config.js', import.meta.url));
|
|
process.env.SUPABASE_URL ||= 'http://localhost';
|
|
process.env.SUPABASE_SERVICE_KEY ||= 'x';
|
|
process.env.JWT_SECRET ||= 'x';
|
|
process.env.SITE_DIR ||= '/tmp/nosite';
|
|
|
|
const { systemInfo } = await import('../src/routes/system.js');
|
|
|
|
test('systemInfo reflects core version, plugins and content model', () => {
|
|
const info = systemInfo({ version: '0.6.0', hugo: '0.161.1+extended' });
|
|
assert.equal(info.core.name, 'openbureau-core');
|
|
assert.equal(info.core.version, '0.6.0');
|
|
assert.equal(info.site, 'openbureau');
|
|
assert.equal(info.auth, 'supabase'); // openbureau.config.js sets auth: 'supabase'
|
|
assert.equal(info.hugo, '0.161.1+extended');
|
|
assert.deepEqual(info.admins, ['karim@gabrielevarano.ch']);
|
|
// dialog plugin is active with its routes + the one migration
|
|
const dialog = info.plugins.find((p) => p.name === 'dialog');
|
|
assert.ok(dialog, 'dialog plugin listed');
|
|
assert.ok(dialog.routes > 0);
|
|
assert.equal(dialog.migrations, 1);
|
|
// content model surfaced from the config collections
|
|
assert.deepEqual(info.collections.map((c) => c.kind).sort(), ['beitrag', 'biblio', 'rubrik', 'seite']);
|
|
const beitrag = info.collections.find((c) => c.kind === 'beitrag');
|
|
assert.equal(beitrag.label, 'Beiträge');
|
|
assert.ok(beitrag.fields > 0);
|
|
});
|