Versie 0.3.3

This commit is contained in:
Atreides Assets committed 2026-10-30 12:28:48 +01:00
1 parent 1cf6eeed29
commit 6e741a51fe
57 files changed
+1362 -2135

No files matched your search

+10 -1
View File
@@ -1,4 +1,4 @@
// Generated, do not edit. sha256:e7c1f8e0ef8ff3927bf8ff8a92bc2028aac07446bbf50cb1b0842db32ca8e5f3
// Generated, do not edit. sha256:500c3d5e31a736de36a900bebc7682d080b1ebb8cda99a94331c6ce11a3fab67
import { describe, it, beforeEach, afterEach, mock } from 'node:test';
import assert from 'node:assert/strict';
import { mkdtemp, rm } from 'node:fs/promises';
@@ -16,6 +16,7 @@ mock.module('../../server/license.mjs', {
});
const { listPortfolios } = await import('../../server/portfolios.mjs');
const { CONFIG } = await import('../../shared/config.js');
const { createPortfolio, archivePortfolio } = await import('../../server/portfolios-admin.mjs');
let DIR;
@@ -50,6 +51,14 @@ describe('de gratis stand op portefeuilles', () => {
assert.deepEqual(listPortfolios().map((p) => p.naam), ['Eerste']);
});
it('telt de demo niet mee: naast de demo past nog een eigen portefeuille', async () => {
stand = { level: 'full', enforced: true, why: 'licensed' };
await createPortfolio(CONFIG.PORTFOLIO.DEMO_NAME);
stand = { level: 'free', enforced: true, why: 'none' };
await createPortfolio('Eigen');
await assert.rejects(() => createPortfolio('Tweede'), (fout) => fout.key === 'portfolios.maxFree');
});
it('laat de tweede WEL toe in de betaalde stand', async () => {
await createPortfolio('Eerste');
stand = { level: 'full', enforced: true, why: 'licensed' };
+8 -5
View File
@@ -1,4 +1,4 @@
// Generated, do not edit. sha256:4b1eef4e0860bce440fbf0875965c32cd7b13b237d0ffc92ef0255b11fe9a950
// Generated, do not edit. sha256:687aaa4f407ca89e2e9f7cb5d0e2f1e02a1d00b4fdf4b9f0890c187e9171588f
import { describe, it, before, after } from 'node:test';
import assert from 'node:assert/strict';
import { spawn } from 'node:child_process';
@@ -30,10 +30,13 @@ const wijsNaar = (naam) => writeFile(join(dir, 'active.json'), JSON.stringify({
before(async () => {
dir = await mkdtemp(join(tmpdir(), 'assetapp-mcp-wissel-'));
proc = spawn(process.execPath, [STDIO], {
env: { ...process.env, ASSETAPP_DATA_DIR: dir },
stdio: ['pipe', 'pipe', 'pipe'],
});
const env = { ...process.env, ASSETAPP_DATA_DIR: dir };
const eerste = spawn(process.execPath, [STDIO], { env, stdio: 'ignore' });
await new Promise((klaar) => eerste.once('exit', klaar));
const db = new DatabaseSync(join(dir, 'MyAssets', 'db.sqlite'));
db.exec(`UPDATE Preference SET value = '1' WHERE scope = 'ai' AND key = 'enabled'`);
db.close();
proc = spawn(process.execPath, [STDIO], { env, stdio: ['pipe', 'pipe', 'pipe'] });
proc.stdout.on('data', (brok) => {
buffer += brok.toString();
let n;
+11 -7
View File
@@ -1,4 +1,4 @@
// Generated, do not edit. sha256:7bb4b4b51bf14bf2fa32107d316282a41f1c7586c33fc94c43098199bfa75953
// Generated, do not edit. sha256:d705db22a94bcceb849648fab7596bd5a84e34d8b58a472ec9dc677c8db0cc0a
import { describe, it, before, after } from 'node:test';
import assert from 'node:assert/strict';
import { spawn } from 'node:child_process';
@@ -11,7 +11,7 @@ import { fileURLToPath } from 'node:url';
const WORTEL = join(fileURLToPath(import.meta.url), '..', '..', '..');
const STDIO = join(WORTEL, 'server', 'mcp', 'stdio.mjs');
let dir, proc, buffer = '', wachtenden = [];
let dir, dbPad, proc, buffer = '', wachtenden = [];
function stuur(bericht) {
return new Promise((resolve, reject) => {
@@ -24,10 +24,14 @@ function stuur(bericht) {
before(async () => {
dir = await mkdtemp(join(tmpdir(), 'assetapp-mcp-stdio-'));
proc = spawn(process.execPath, [STDIO], {
env: { ...process.env, ASSETAPP_DATA_DIR: dir, ASSETAPP_DB_FILE: join(dir, 'db.sqlite') },
stdio: ['pipe', 'pipe', 'pipe'],
});
dbPad = join(dir, 'MyAssets', 'db.sqlite');
const env = { ...process.env, ASSETAPP_DATA_DIR: dir, ASSETAPP_DB_FILE: dbPad };
const eerste = spawn(process.execPath, [STDIO], { env, stdio: 'ignore' });
assert.equal(await new Promise((klaar) => eerste.once('exit', klaar)), 0, 'een verse installatie stopt met de koppeling uit');
const db = new DatabaseSync(dbPad);
db.exec(`UPDATE Preference SET value = '1' WHERE scope = 'ai' AND key = 'enabled'`);
db.close();
proc = spawn(process.execPath, [STDIO], { env, stdio: ['pipe', 'pipe', 'pipe'] });
proc.stdout.on('data', (brok) => {
buffer += brok.toString();
let n;
@@ -74,7 +78,7 @@ describe('mcp-stdio: het proces beantwoordt bericht na bericht', () => {
describe('mcp-stdio: de schuif "Actief" zet dit proces uit', () => {
it('stopt bij het eerstvolgende bericht zodra de schuif uit gaat', async () => {
const db = new DatabaseSync(join(dir, 'db.sqlite'));
const db = new DatabaseSync(dbPad);
db.exec(`PRAGMA busy_timeout = 5000`);
db.exec(`INSERT INTO Preference (scope, key, value) VALUES ('ai', 'enabled', '0')
ON CONFLICT (scope, key) DO UPDATE SET value = '0'`);