Files
wownerogue/test/payoutDisclosureClient.test.js
T

21 lines
768 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const fs = require('fs');
const path = require('path');
describe('browser payout disclosures', () => {
test('renders server-computed outcomes and never recreates multiplier amounts', () => {
const paymentUi = fs.readFileSync(
path.join(__dirname, '../html/js/ui/paymentUI.js'),
'utf8'
);
const help = fs.readFileSync(
path.join(__dirname, '../html/js/ui/helpModal.js'),
'utf8'
);
expect(paymentUi).toContain('this.config?.payoutOutcomes?.[mode]');
expect(paymentUi).toContain('configured cap applied');
expect(paymentUi).not.toMatch(/parseFloat\([^\n]+\)\s*\*\s*[^\n]*multiplier/i);
expect(help).not.toMatch(/Escape pays[\s\S]{0,80}×/);
});
});