@@ -0,0 +1,33 @@
|
||||
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/);
|
||||
});
|
||||
Reference in New Issue
Block a user