Files
Investidor-V2/tests/frontend/simulator-entry.test.mjs
T
nala e65cb26901
tests / ci (push) Canceled after 0s
varias alteracoes
2026-10-06 14:50:12 +02:00

34 lines
1.0 KiB
JavaScript

import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';
const homePage = readFileSync(
new URL('../../resources/js/pages/PortalInvestidor.tsx', import.meta.url),
'utf8',
);
const simulator = readFileSync(
new URL(
'../../resources/js/components/simulation-form.tsx',
import.meta.url,
),
'utf8',
);
test('portal home hero exposes a direct public simulator link', () => {
const hero = homePage.slice(
homePage.indexOf('function Hero('),
homePage.indexOf('function SectorGrid('),
);
assert.match(hero, /href="\/simulador-fiscal"/);
assert.match(hero, /Planear finanças/);
});
test('completed simulator result keeps public interest submission independent', () => {
assert.match(simulator, /href="\/manifestar-interesse"/);
assert.match(
simulator,
/Manifestar interesse sem partilhar\s+esta simulação/,
);
assert.match(simulator, /sem\s+partilhar os dados desta simulação/);
});