test(e2e): add coverage for all 12 critical journeys (TEST-3 #405)
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Failing after 3m32s
CI / OCR Service Tests (pull_request) Successful in 29s
CI / Backend Unit Tests (pull_request) Failing after 3m3s
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Failing after 3m32s
CI / OCR Service Tests (pull_request) Successful in 29s
CI / Backend Unit Tests (pull_request) Failing after 3m3s
Adds docs/audits/e2e-coverage-report.md mapping all 12 critical journeys to their test files. Fills the 6 coverage gaps with new e2e tests: - J1: Register via invite code (auth.spec.ts) - J3: Edit document tags via TagInput (documents.spec.ts) - J4: Create brand-new tag via TagInput (documents.spec.ts) - J5: Add SPOUSE_OF relationship on person edit page (persons.spec.ts) - J6: Multi-filter search (text + date, text + tagId) (documents.spec.ts) - J10: Notification bell opens dropdown (notification-deep-link.spec.ts) - J11: Non-admin blocked from /admin/* (permissions.spec.ts) - J12: Mass import trigger shows status (admin.spec.ts) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -181,3 +181,61 @@ test.describe('Person detail — sent and received documents', () => {
|
||||
// If no person has dated documents, the test is a no-op (year range is optional)
|
||||
});
|
||||
});
|
||||
|
||||
// ── J5: Add a relationship on the person edit page ────────────────────────
|
||||
//
|
||||
// Creates two persons via API, then opens the first person's edit page and
|
||||
// uses the AddRelationshipForm to link them. Asserts the chip appears.
|
||||
|
||||
test.describe('Person relationship — add via edit page (J5)', () => {
|
||||
const baseURL = process.env.E2E_BASE_URL ?? 'http://localhost:3000';
|
||||
let personAHref: string;
|
||||
let personBName: string;
|
||||
|
||||
test.beforeAll(async ({ request }) => {
|
||||
const stamp = Date.now().toString(36);
|
||||
|
||||
const aRes = await request.post('/api/persons', {
|
||||
data: { firstName: 'E2E-Rel-A', lastName: stamp }
|
||||
});
|
||||
if (!aRes.ok()) throw new Error(`Create person A failed: ${aRes.status()}`);
|
||||
const a = await aRes.json();
|
||||
personAHref = `${baseURL}/persons/${a.id}`;
|
||||
|
||||
const bRes = await request.post('/api/persons', {
|
||||
data: { firstName: 'E2E-Rel-B', lastName: stamp }
|
||||
});
|
||||
if (!bRes.ok()) throw new Error(`Create person B failed: ${bRes.status()}`);
|
||||
const b = await bRes.json();
|
||||
personBName = b.displayName ?? `E2E-Rel-B ${stamp}`;
|
||||
});
|
||||
|
||||
test('user adds a SPOUSE_OF relationship and sees the chip on the edit page', async ({
|
||||
page
|
||||
}) => {
|
||||
await page.goto(`${personAHref}/edit`);
|
||||
await page.waitForSelector('[data-hydrated]');
|
||||
|
||||
// Open the AddRelationshipForm by clicking the "+ Beziehung hinzufügen" button.
|
||||
await page.getByRole('button', { name: '+ Beziehung hinzufügen' }).click();
|
||||
|
||||
// Select SPOUSE_OF from the type dropdown.
|
||||
await page.selectOption('select[name="relationType"]', 'SPOUSE_OF');
|
||||
|
||||
// Type person B's name in the PersonTypeahead.
|
||||
const personInput = page.getByRole('combobox', { name: /Person/i });
|
||||
await expect(personInput).toBeVisible({ timeout: 5_000 });
|
||||
await personInput.fill('E2E-Rel-B');
|
||||
|
||||
const suggestion = page.getByRole('option').first();
|
||||
await expect(suggestion).toBeVisible({ timeout: 5_000 });
|
||||
await suggestion.click();
|
||||
|
||||
// Submit the relationship form.
|
||||
await page.getByRole('button', { name: 'Hinzufügen' }).click();
|
||||
|
||||
// The relationship chip should appear in the Stammbaum section.
|
||||
await expect(page.getByText(personBName)).toBeVisible({ timeout: 8_000 });
|
||||
await page.screenshot({ path: 'test-results/e2e/person-relationship-added.png' });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user