Versie 0.3.3
This commit is contained in:
1 parent
1cf6eeed29
commit
6e741a51fe
57 files changed
+1362
-2135
No files matched your search
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:38c4b07d1566cda74ef6cac4d031f49fd52004b6938fdee8f13e3e7678fc12c7
|
||||
// Generated, do not edit. sha256:13b6b32cbbf6b8c4a6a6069af37a7be33560a8abfc2af81ae2b4009e9692d7c6
|
||||
import { describe, it, beforeEach, mock } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createDbHarness } from '../helpers/db-node.mjs';
|
||||
@@ -22,6 +22,7 @@ mock.module('../../server/license.mjs', {
|
||||
|
||||
const { createAsset, updateAsset, deleteAsset, listAssets } = await import('../../server/data/assets.js');
|
||||
const { createAccount, listAccounts } = await import('../../server/data/accounts.js');
|
||||
const { mergeAccounts } = await import('../../server/data/accounts-merge.js');
|
||||
const { createValuation, listValuations } = await import('../../server/data/valuations.js');
|
||||
const { saveConnection, listConnections } = await import('../../server/data/connections.js');
|
||||
const { setPriceSourceRank } = await import('../../server/data/price-source.js');
|
||||
@@ -148,23 +149,10 @@ describe('de gratis stand op balansen', () => {
|
||||
rateAt: `${dag}T00:00:00Z`, source: 'manual',
|
||||
});
|
||||
|
||||
it('laat ÉÉN balans toe en weigert de tweede', async () => {
|
||||
it('kent geen grens: ook de gratis stand legt balans na balans vast', async () => {
|
||||
const asset = await createAsset(EEN);
|
||||
await createValuation(balans(asset, '2026-01-01'));
|
||||
await assert.rejects(() => createValuation(balans(asset, '2026-02-01')), (fout) => {
|
||||
assert.equal(fout.key, 'valuations.maxFree');
|
||||
assert.equal(fout.params.max, 1);
|
||||
return true;
|
||||
});
|
||||
assert.equal(listValuations().length, 1);
|
||||
});
|
||||
|
||||
it('laat de tweede WEL toe in de betaalde stand', async () => {
|
||||
const asset = await createAsset(EEN);
|
||||
await createValuation(balans(asset, '2026-01-01'));
|
||||
stand = { level: 'full', enforced: true, why: 'licensed' };
|
||||
await createValuation(balans(asset, '2026-02-01'));
|
||||
assert.equal(listValuations().length, 2);
|
||||
for (const dag of ['2026-01-01', '2026-02-01', '2026-03-01']) await createValuation(balans(asset, dag));
|
||||
assert.equal(listValuations().length, 3);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -212,4 +200,15 @@ describe('de features van de gratis stand', () => {
|
||||
await assert.rejects(() => setPriceSourceRank(asset, 'spot', 1),
|
||||
(f) => f.key === 'integrations.matrixPaid');
|
||||
});
|
||||
|
||||
it('weigert accounts samenvoegen en laat beide accounts staan; betaald gaat het door', async () => {
|
||||
const wallet = (name) => ({ name, kind: 'wallet', isOwnCustody: true, scanEnabled: false, taxCategory: null });
|
||||
const a = await createAccount(wallet('A'));
|
||||
const b = await createAccount(wallet('B'));
|
||||
await assert.rejects(() => mergeAccounts(a, b), (f) => f.key === 'accounts.mergePaid');
|
||||
assert.equal(listAccounts().length, 2);
|
||||
stand = { level: 'full', enforced: true, why: 'licensed' };
|
||||
await mergeAccounts(a, b);
|
||||
assert.deepEqual(listAccounts().map(r => r.id), [a]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user