diff --git a/tests/frontend/simulator-entry.test.mjs b/tests/frontend/simulator-entry.test.mjs index 0e6899ea..0d8425d9 100644 --- a/tests/frontend/simulator-entry.test.mjs +++ b/tests/frontend/simulator-entry.test.mjs @@ -14,13 +14,14 @@ const simulator = readFileSync( 'utf8', ); -void test('portal home hero exposes a direct public simulator link', () => { - const hero = homePage.slice( - homePage.indexOf('function Hero('), - homePage.indexOf('function SectorGrid('), +void test('portal home investor support exposes a direct public simulator link', () => { + const supportHeading = homePage.indexOf('Apoio ao Investidor'); + assert.ok(supportHeading >= 0, 'home investor support must exist'); + const support = homePage.slice( + supportHeading, + homePage.indexOf('', supportHeading), ); - assert.match(hero, /href="\/simulador-fiscal"/); - assert.match(hero, /Planear finanças/); + assert.match(support, /]*href="\/simulador-fiscal"[^>]*>[\s\S]*?Simulador Fiscal[\s\S]*?<\/a>/); }); void test('completed simulator result keeps public interest submission independent', () => {