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);
+3 -1
View File
@@ -207,7 +207,9 @@ test('script payloads render as plain text in the audit diff and the import prev
await expect(diff).toBeVisible();
const row = diff.locator('tbody tr').filter({ has: ui.page.locator('th', { hasText: new RegExp(`^(record ${id}\\.)?content$`) }) });
await expect(row).toHaveCount(1);
await expect(row.locator('td').nth(side === 'Before' ? 0 : 1)).toHaveText(JSON.stringify(content).replace(/\s+/g, ' '));
const marker = side === 'Before' ? '−' : '+';
const cell = row.getByRole('group', { name: side + ' content' });
await expect(cell).toHaveText(`${marker} Text: ${JSON.parse(content).text}`);
await expect(ui.page.locator('#app script, #app img')).toHaveCount(0);
};
const pwned = () => ui.page.evaluate(() => (window as unknown as { __pwned?: number }).__pwned);