From 93bda37c29e964fd73212a7969b7bac2de672965 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Thu, 22 Oct 2026 01:46:03 -0300 Subject: [PATCH] =?UTF-8?q?test(e2e):=20alinha=20o=20acervo=20=C3=A0=20Cen?= =?UTF-8?q?tral=20p=C3=BAblica=20retirada=20(S47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Os testes de exclusão da Central deixam de esperar o antigo /conteudos/ (200/404) e passam a pinar o redirect permanente para /artigos, mantendo o contrato do arquivo privado no /campanha. --- tests/e2e/campaignSpeechAcervo.e2e.spec.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/e2e/campaignSpeechAcervo.e2e.spec.ts b/tests/e2e/campaignSpeechAcervo.e2e.spec.ts index 081c5c1c..226d1065 100644 --- a/tests/e2e/campaignSpeechAcervo.e2e.spec.ts +++ b/tests/e2e/campaignSpeechAcervo.e2e.spec.ts @@ -1839,10 +1839,15 @@ test.describe('communication vertical (C154/C162)', () => { ) expect(ficha).toContain('Apagar') + // S47 — the public Central routes are retired: the slug and its media + // answer the permanent redirect regardless of the piece state. const publicBefore = await playwrightRequest.newContext({ baseURL: campaign.baseURL }) try { - expect((await publicBefore.get(`/conteudos/${slug}`)).status()).toBe(200) - expect((await publicBefore.get(`/conteudos/${slug}/midia`)).status()).toBe(200) + for (const path of [`/conteudos/${slug}`, `/conteudos/${slug}/midia`]) { + const response = await publicBefore.get(path, { maxRedirects: 0 }) + expect(response.status()).toBe(308) + expect(new URL(response.headers().location, campaign.baseURL).pathname).toBe('/artigos') + } } finally { await publicBefore.dispose() } @@ -1874,8 +1879,10 @@ test.describe('communication vertical (C154/C162)', () => { const anonymous = await playwrightRequest.newContext({ baseURL: campaign.baseURL }) try { - expect((await anonymous.get(`/conteudos/${slug}`)).status()).toBe(404) - expect((await anonymous.get(`/conteudos/${slug}/midia`)).status()).toBe(404) + expect((await anonymous.get(`/conteudos/${slug}`, { maxRedirects: 0 })).status()).toBe(308) + expect( + (await anonymous.get(`/conteudos/${slug}/midia`, { maxRedirects: 0 })).status(), + ).toBe(308) } finally { await anonymous.dispose() } @@ -1950,7 +1957,7 @@ test.describe('communication vertical (C154/C162)', () => { const anonymous = await playwrightRequest.newContext({ baseURL: campaign.baseURL }) try { - expect((await anonymous.get(`/conteudos/${slug}`)).status()).toBe(404) + expect((await anonymous.get(`/conteudos/${slug}`, { maxRedirects: 0 })).status()).toBe(308) } finally { await anonymous.dispose() }