Improve audit diffs and gate image releases on main CI
Test / test (push) Failing after 3m43s

This commit is contained in:
bryanpedini committed 2026-11-20 18:43:07 +01:00
1 parent 65d16c2fc6
commit 32a0cf6801
6 files changed
+207 -39

No files matched your search

+17
View File
@@ -1076,6 +1076,23 @@ test.describe('core flow', () => {
const diff = adminUi.page.locator('#audit-body tr.detail-row:not([hidden]) table.diff');
await expect(diff).toBeVisible();
await expect(diff.locator('tr.diff-changed').first()).toBeVisible();
const soaEntries = await adminApi.get('/audit', { query: { zone, operation: 'soa_update', limit: 1 } });
const soaEntry = soaEntries.json.entries[0];
expect(soaEntry.before).toMatchObject({ record_type: 'SOA', ttl: 3600, content: expect.any(String) });
expect(soaEntry.after).toMatchObject({ record_type: 'SOA', ttl: 1800, content: expect.any(String) });
expect(JSON.parse(soaEntry.after.content)).toMatchObject({ refresh: 7200, retry: 900, minttl: 600 });
await adminUi.filterAudit({ zone, operation: 'soa_update' });
await toggle.click();
const type = diff.getByRole('rowheader', { name: 'type', exact: true });
await expect(type).toBeVisible();
await expect(diff.getByRole('rowheader', { name: 'record_type', exact: true })).toHaveCount(0);
const content = diff.locator('tr.diff-content-row');
await expect(content.getByRole('rowheader', { name: 'content', exact: true })).toHaveCSS('white-space', 'nowrap');
await expect(content.getByRole('group', { name: 'Before content' })).toHaveCSS('white-space', 'pre');
await expect(content.locator('.diff-before').filter({ hasText: 'Refresh: 3600' })).toHaveText('− Refresh: 3600');
await expect(content.locator('.diff-after').filter({ hasText: 'Refresh: 7200' })).toHaveText('+ Refresh: 7200');
await expect(content.locator('.diff-after').filter({ hasText: 'Primary name server' })).toHaveCount(0);
await adminUi.filterAudit({ zone: '', operation: '', outcome: 'error' });
for (const r of await adminUi.auditRows()) expect(Number(r.status.slice(0, 3))).toBeGreaterThanOrEqual(400);