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,7 +1,7 @@
|
||||
// Generated, do not edit. sha256:3b34cf97cc5aa20ba08ae8a6246f0235b943e5e85fc0d31e21707e06b2c2c371
|
||||
// Generated, do not edit. sha256:d235c44eb19e911ab77974e75ddb595cbc8249ee72a4b4a543123c373e4e6b5f
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { periodChoices, startPeriod, returnLine, idsForSelection, contributorsPerDay } from '../../client/wealth/return-view.js';
|
||||
import { periodChoices, startPeriod, returnLine, idsForSelection, contributorsPerDay, flatLine } from '../../client/wealth/return-view.js';
|
||||
import { dagreeks, seriesFor, meetVenster } from '../../client/wealth/series.js';
|
||||
import { windowTwr } from '../../client/wealth/performance.js';
|
||||
|
||||
@@ -94,6 +94,22 @@ describe('returnLine', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('flatLine', () => {
|
||||
it('geeft nul over de periode, eindigend op vandaag, oudste eerst', () => {
|
||||
const f = flatLine(7, '2026-10-29');
|
||||
assert.equal(f.amount, 0);
|
||||
assert.equal(f.pct, 0);
|
||||
assert.equal(f.labels.length, 7);
|
||||
assert.equal(f.labels[0], '2026-10-23');
|
||||
assert.equal(f.labels.at(-1), '2026-10-29');
|
||||
assert.ok(f.points.every(p => p.cumulative === 0));
|
||||
});
|
||||
|
||||
it('heeft minstens twee punten, ook voor één dag', () => {
|
||||
assert.deepEqual(flatLine(1, '2026-10-29').labels, ['2026-10-28', '2026-10-29']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('seriesFor met een groep', () => {
|
||||
it('is met alle assets erin hetzelfde als het totaal', () => {
|
||||
const r = reeks();
|
||||
|
||||
Reference in new issue
Block a user