forked from unimatrix/web
Expand public tariffs with tax rules, reserve instruments and economic formulas; add complete PDF and audited direct publisher
This commit is contained in:
parent
857cdf5d6f
commit
8eca3945ba
1 changed files with 189 additions and 10 deletions
15
website/tests/rates-reference.test.mjs
Normal file
15
website/tests/rates-reference.test.mjs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import test from 'node:test';import assert from 'node:assert/strict';import {readFileSync} from 'node:fs';
|
||||
import {ratesReferenceSections,ratesReferenceHTML} from '../scripts/rates-reference.mjs';
|
||||
import {bankRatesPage} from '../scripts/bank-rates-page.mjs';
|
||||
test('complete tariff handbook covers implemented formulas, availability, payers and destinations without exposing developer codes',()=>{
|
||||
const sections=ratesReferenceSections(),html=bankRatesPage();
|
||||
for(const id of ['tax-rules','publication-charges','reserve-instruments','economy-formulas','payroll-formulas'])assert(sections.some(s=>s.id===id));
|
||||
assert.match(html,/Download complete guide/);assert.match(html,/ECO-SNAP/);assert.match(html,/Server\/CLI only/);assert.match(html,/not enabled by publishing/);assert.match(html,/3,000 DM/);
|
||||
assert(!html.includes('DEV-BATCH.'));assert(!html.includes('DB_PASSWORD'));assert.match(ratesReferenceHTML(),/Tax treasury/);
|
||||
assert.equal(sections.filter(s=>s.id.startsWith('guide-claims-')).length,3);
|
||||
});
|
||||
test('download references the public financial snapshot and ships a real PDF',()=>{
|
||||
const manifest=JSON.parse(readFileSync(new URL('../web/downloads/rates-guide-manifest.json',import.meta.url),'utf8'));
|
||||
assert.match(manifest.sourcePublicationVersion,/^[a-f0-9-]{36}$/i);
|
||||
const pdf=readFileSync(new URL('../web'+manifest.pdf,import.meta.url));assert.equal(pdf.subarray(0,5).toString(),'%PDF-');assert(pdf.length>20000);
|
||||
});
|
||||
Loading…
Reference in a new issue

Staff