test: aceitar Revista Tempo no cabeçalho e Contacto só no rodapé
tests / ci (push) Waiting to run

Decisão do proprietário (01/12/2026) sobre as alterações do cabeçalho de
23/11 (ad403b4, 8caf3e4): «Revista Tempo» passa a entrada principal, antes
de «Mais», e abre num novo separador; «Contacto» sai do cabeçalho e fica
no rodapé. Os dois testes do menu que bloqueavam o deploy de 85d99757
passam a exigir este comportamento, e o teste do rodapé passa a exigir o
link para /contacto.

Bateria de frontend: 2170/2170.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 21:38:46 +02:00
co-authored by Claude Opus 5.5
parent 85d9975792
commit 2ced298585
2 changed files with 14 additions and 3 deletions
@@ -40,6 +40,8 @@ test('footer identifies the decided operator without implying a public partnersh
assert.match(html, /Operado por.*Tempo, Lda\./s); assert.match(html, /Operado por.*Tempo, Lda\./s);
assert.match(html, /mailto:institution@example.invalid/); assert.match(html, /mailto:institution@example.invalid/);
assert.doesNotMatch(html, /parceria com a APIEX/); assert.doesNotMatch(html, /parceria com a APIEX/);
// Decisão do proprietário (01/12/2026): o acesso a «Contacto» está no rodapé, não no cabeçalho.
assert.match(html, /<a[^>]*href="\/contacto"[^>]*>[\s\S]*?Contacto/);
}); });
test('support distinguishes the existing institutional contact from dedicated support', () => { test('support distinguishes the existing institutional contact from dedicated support', () => {
+12 -3
View File
@@ -101,7 +101,7 @@ compileFunction(output, ['require', 'module', 'exports'])(
module, module,
module.exports, module.exports,
); );
test('actual header has exactly the requested six primary entries on desktop and mobile for public and signed-in users', () => { test('actual header has exactly the requested primary entries, with Revista Tempo before Mais, on desktop and mobile for public and signed-in users', () => {
const out = new URL( const out = new URL(
'../../outputs/funding-uniform-menu-20261111/', '../../outputs/funding-uniform-menu-20261111/',
import.meta.url, import.meta.url,
@@ -143,18 +143,26 @@ test('actual header has exactly the requested six primary entries on desktop and
'Realização', 'Realização',
'Suporte', 'Suporte',
'Sobre nós', 'Sobre nós',
'Revista Tempo',
'Mais', 'Mais',
]); ]);
// Decisão do proprietário (01/12/2026): a Revista Tempo é entrada principal do cabeçalho.
assert.ok(
/<a[^>]*href="https:\/\/revista\.tempo\.co\.mz\/"[^>]*target="_blank"[^>]*rel="noopener noreferrer"/.test(
nav,
),
);
for (const href of [ for (const href of [
'/concursos', '/concursos',
'/fundos', '/fundos',
'/documentos', '/documentos',
'/legislacao', '/legislacao',
'/sobre', '/sobre',
'/contacto',
'/acesso-gestao', '/acesso-gestao',
]) ])
assert.ok(html.includes('href="' + href + '"'), href); assert.ok(html.includes('href="' + href + '"'), href);
// Decisão do proprietário (01/12/2026): «Contacto» fica só no rodapé.
assert.equal(nav.includes('href="/contacto"'), false);
assert.ok(html.includes('step=S08')); assert.ok(html.includes('step=S08'));
assert.equal(html.includes('/management/'), false); assert.equal(html.includes('/management/'), false);
fs.writeFileSync( fs.writeFileSync(
@@ -179,6 +187,7 @@ test('actual header has exactly the requested six primary entries on desktop and
'Realização', 'Realização',
'Suporte', 'Suporte',
'Sobre nós', 'Sobre nós',
'Revista Tempo',
'Mais', 'Mais',
], ],
actualHeaderRendered: true, actualHeaderRendered: true,
@@ -200,7 +209,7 @@ test('authorised administration is primary and dashboard is a nested expandable
const nav = html.match(/<nav[^>]*aria-label="Áreas do portal"[\s\S]*?<\/nav>/)?.[0]; const nav = html.match(/<nav[^>]*aria-label="Áreas do portal"[\s\S]*?<\/nav>/)?.[0];
assert.ok(nav); assert.ok(nav);
const labels = [...nav.matchAll(/<(?:a|button)[^>]*class="tempo-nav-trigger"[^>]*>([\s\S]*?)<\/(?:a|button)>/g)].map(m => m[1].replace(/<[^>]*>/g, '').replace('Grupo actual', '').trim()); const labels = [...nav.matchAll(/<(?:a|button)[^>]*class="tempo-nav-trigger"[^>]*>([\s\S]*?)<\/(?:a|button)>/g)].map(m => m[1].replace(/<[^>]*>/g, '').replace('Grupo actual', '').trim());
assert.deepEqual(labels, ['Início', 'Descoberta', 'Realização', 'Suporte', 'Administração', 'Sobre nós', 'Mais']); assert.deepEqual(labels, ['Início', 'Descoberta', 'Realização', 'Suporte', 'Administração', 'Sobre nós', 'Revista Tempo', 'Mais']);
assert.equal((nav.match(/href="\/management\/editorial"/g) ?? []).length, 1); assert.equal((nav.match(/href="\/management\/editorial"/g) ?? []).length, 1);
assert.match(nav, /Dashboard/); assert.match(nav, /Dashboard/);
if (mobile) assert.match(nav, /<summary[^>]*>Dashboard<\/summary>/); if (mobile) assert.match(nav, /<summary[^>]*>Dashboard<\/summary>/);