From 438ac727fe9e945fa108391a08559d2b51b63f93 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Thu, 13 Aug 2026 15:51:15 -0300 Subject: [PATCH] =?UTF-8?q?fix(C139):=20e2e=20campaignContacts=20n=C3=A3o?= =?UTF-8?q?=20vaza=20contatos=20criados=20pela=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O nome letters-only não carrega o runID, então o discoverOwnedRows do ownership não encontra o contato criado via formulário (create row/sheet) e a limpeza da fixture o deixava para trás — cada run vazava 2 contatos no banco de teste. Deletar explicitamente por nome exato no fim do teste. --- tests/e2e/campaignContacts.e2e.spec.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/e2e/campaignContacts.e2e.spec.ts b/tests/e2e/campaignContacts.e2e.spec.ts index 2afd5b34..6c23c529 100644 --- a/tests/e2e/campaignContacts.e2e.spec.ts +++ b/tests/e2e/campaignContacts.e2e.spec.ts @@ -116,6 +116,15 @@ test.describe('Contatos — página da entidade Contact', () => { }) expect(stored.docs).toHaveLength(1) expect(stored.docs[0]!.phones?.[0]?.value).toBe(phone) + + // The row was created THROUGH the UI, so the ownership proxy never tracked + // it (and its letters-only name does not carry the runID, so discovery + // cannot find it) — delete it explicitly or every run leaks a contact. + await fixtures.payload.delete({ + collection: 'contact', + where: { name: { equals: contactName } }, + depth: 0, + }) }) test('a duplicate name shows the safe conflict message in the create row', async ({ @@ -201,6 +210,14 @@ test.describe('Contatos — página da entidade Contact', () => { await expect( card.getByRole('link', { name: `Enviar WhatsApp para ${contactName}` }), ).toHaveAttribute('href', `https://wa.me/55${phone}`) + + // UI-created (see the desktop create-row test): delete explicitly so the + // ownership discovery (runID in name) is not the only net. + await fixtures.payload.delete({ + collection: 'contact', + where: { name: { equals: contactName } }, + depth: 0, + }) }) test('mobile: the edit sheet keeps values on conflict and saves the ficha atomically', async ({