Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+34
@@ -0,0 +1,34 @@
|
||||
import type { TFunction } from "i18next";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
translateIpAddressLogAction,
|
||||
translateIpAddressLogDescription,
|
||||
translateIpAddressLogError,
|
||||
} from "./ipAddressLogLabels";
|
||||
|
||||
const t = ((key: string, options?: Record<string, unknown>) => (options?.value ? `${key}:${String(options.value)}` : key)) as TFunction;
|
||||
|
||||
describe("IP address log labels", () => {
|
||||
it("translates known action codes and wraps unknown values in a semantic key", () => {
|
||||
expect(translateIpAddressLogAction(t, "login")).toBe("admin.accounts.ipAddresses.logs.actions.login");
|
||||
expect(translateIpAddressLogAction(t, "register")).toBe("admin.accounts.ipAddresses.logs.actions.register");
|
||||
expect(translateIpAddressLogAction(t, "reset")).toBe("admin.accounts.ipAddresses.logs.actions.reset");
|
||||
expect(translateIpAddressLogAction(t, "forgot-password")).toBe("admin.accounts.ipAddresses.logs.actions.forgotPassword");
|
||||
expect(translateIpAddressLogAction(t, "reset-password")).toBe("admin.accounts.ipAddresses.logs.actions.resetPassword");
|
||||
expect(translateIpAddressLogAction(t, " custom-action ")).toBe("admin.accounts.ipAddresses.logs.actions.unknownWithValue:custom-action");
|
||||
expect(translateIpAddressLogAction(t, " ")).toBe("");
|
||||
});
|
||||
|
||||
it("translates known description codes and wraps unknown values in a semantic key", () => {
|
||||
expect(translateIpAddressLogDescription(t, "registration-attempt")).toBe("admin.accounts.ipAddresses.logs.descriptions.registrationAttempt");
|
||||
expect(translateIpAddressLogDescription(t, "{empty email}")).toBe("admin.accounts.ipAddresses.logs.descriptions.emptyEmail");
|
||||
expect(translateIpAddressLogDescription(t, "custom description")).toBe("admin.accounts.ipAddresses.logs.descriptions.unknownWithValue:custom description");
|
||||
expect(translateIpAddressLogDescription(t, null)).toBe("");
|
||||
});
|
||||
|
||||
it("translates known error codes and wraps unknown values in a semantic key", () => {
|
||||
expect(translateIpAddressLogError(t, "blacklisted")).toBe("admin.accounts.ipAddresses.errors.blacklisted");
|
||||
expect(translateIpAddressLogError(t, "Unauthorized.")).toBe("admin.accounts.ipAddresses.errors.unauthorized");
|
||||
expect(translateIpAddressLogError(t, "provider error")).toBe("admin.accounts.ipAddresses.errors.unknownWithValue:provider error");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user