test: require review fix assertions
- test: require review fix assertions - test: cover zone repair and imported dns records - test: wait for dns and tighten assertions - fix(api): drop the record id of a rolled back record creation - test(audit): run every api route through the real handlers in an audit matrix - test(api): run the authorization matrix through the real zone handlers - test: repair duplicate apex soa through ui
This commit is contained in:
1 parent
a884219512
commit
9251c85fd8
14 files changed
+1631
-123
No files matched your search
@@ -3,15 +3,13 @@
|
||||
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
export const REVIEW_FIXES: boolean = process.env.E2E_REVIEW_FIXES === 'enabled';
|
||||
|
||||
export const UNKNOWN_API_OPERATION = 'api_unknown';
|
||||
export const UNKNOWN_API_ROW_COUNT = REVIEW_FIXES ? 1 : 0;
|
||||
export const RECORD_DELETE_STATUS = REVIEW_FIXES ? 200 : 204;
|
||||
export const ZONE_CREATE_DELEGATIONS_IN = REVIEW_FIXES ? 'before' : 'any';
|
||||
export const UNKNOWN_API_ROW_COUNT = 1;
|
||||
export const RECORD_DELETE_STATUS = 200;
|
||||
export const ZONE_CREATE_DELEGATIONS_IN = 'before';
|
||||
|
||||
export function expectRecordDeleteBody(json: unknown, what: string): void {
|
||||
if (REVIEW_FIXES) expect(json, `${what}: record delete answers its warnings`).toEqual({ warnings: expect.any(Array) });
|
||||
expect(json, `${what}: record delete answers its warnings`).toEqual({ warnings: expect.any(Array) });
|
||||
}
|
||||
|
||||
export function bulkDeleteBody(deleted: number): Record<string, unknown> {
|
||||
@@ -23,11 +21,10 @@ export function importApplyBody(added: number, updated: number, deleted: number)
|
||||
}
|
||||
|
||||
export function expectZoneCreateWarnings(json: unknown): void {
|
||||
if (REVIEW_FIXES) expect((json as { warnings?: unknown }).warnings, 'zone create answers its warnings').toEqual(expect.any(Array));
|
||||
expect((json as { warnings?: unknown }).warnings, 'zone create answers its warnings').toEqual(expect.any(Array));
|
||||
}
|
||||
|
||||
export function expectCheckErrorRowsCarryRaw(rows: Array<{ data: unknown; raw: string | null; problems: Array<{ severity: string }> }>, contentOf: (index: number) => string | null): void {
|
||||
if (!REVIEW_FIXES) return;
|
||||
rows.forEach((r, i) => {
|
||||
if (r.problems.some((p) => p.severity === 'error')) expect(r.raw, 'a row with a check error carries its stored content in raw').toBe(contentOf(i));
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user