mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-11-20 22:13:59 +01:00
23 lines
1006 B
JavaScript
23 lines
1006 B
JavaScript
'use strict';
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const deploy = name => fs.readFileSync(path.join(__dirname, '..', 'scripts', 'deploy', name), 'utf8');
|
|
|
|
describe('deployment financial-audit contract', () => {
|
|
const audit = deploy('financial-audit.sql');
|
|
|
|
test('retained consumed match anchors are not treated as live escrow', () => {
|
|
expect(audit).toMatch(/match_queue_entries\s+WHERE status IS NULL OR status NOT IN \('consumed', 'cancelled'\)/);
|
|
expect(audit).not.toMatch(/status NOT IN \('cancelled'\)/);
|
|
});
|
|
|
|
test('nullable or unknown money/game states and a stale schema ledger fail closed', () => {
|
|
expect(audit).toContain("payouts WHERE status IS DISTINCT FROM 'completed'");
|
|
expect(audit).toContain("games WHERE status IS NULL OR status NOT IN ('won', 'lost', 'expired')");
|
|
expect(audit).toContain("MAX(filename) = '040_paid_match_entropy_precommit.sql'");
|
|
expect(audit).toContain('COUNT(*) = 40');
|
|
});
|
|
});
|