fix(FN-4847): keep engine contract test build-safe
Fusion-Task-Id: FN-4847 Fusion-Task-Lineage: af551b65-a484-496a-8bab-b46193e06104
This commit is contained in:
committed by
gsxdsm
parent
49bc9dd0eb
commit
66ac44fa88
@@ -1,13 +1,18 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { ApiError } from "../../../../dashboard/src/api-error.ts";
|
||||
import {
|
||||
SYNC_STATUS_DENIAL_REASONS,
|
||||
classifySyncStatusDenialReason,
|
||||
} from "../../../../dashboard/src/routes/register-settings-sync-helpers.js";
|
||||
|
||||
// This contract test fails loudly if dashboard denial-reason enum values change without updating cross-node consumers.
|
||||
describe("reliability: node settings sync auth denial-reason contract", () => {
|
||||
it("pins the SyncStatusDenialReason enum values consumed by cross-node sync-status callers", () => {
|
||||
it("pins the SyncStatusDenialReason enum values consumed by cross-node sync-status callers", async () => {
|
||||
const helpersModulePath = "../../../../dashboard/src/routes/register-settings-sync-helpers.js";
|
||||
const apiErrorModulePath = "../../../../dashboard/src/api-error.js";
|
||||
const { SYNC_STATUS_DENIAL_REASONS, classifySyncStatusDenialReason } = await import(helpersModulePath) as {
|
||||
SYNC_STATUS_DENIAL_REASONS: readonly string[];
|
||||
classifySyncStatusDenialReason: (err: unknown) => string;
|
||||
};
|
||||
const { ApiError } = await import(apiErrorModulePath) as {
|
||||
ApiError: new (status: number, message: string) => Error;
|
||||
};
|
||||
|
||||
expect(SYNC_STATUS_DENIAL_REASONS).toEqual(["missing-remote-api-key", "auth-failed", "unreachable", "unknown"]);
|
||||
|
||||
expect(classifySyncStatusDenialReason(new ApiError(400, "Remote node requires an apiKey for authenticated sync"))).toBe("missing-remote-api-key");
|
||||
|
||||
Reference in New Issue
Block a user