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
+22
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import { assertI18nLabel } from "./index.js";
|
||||
|
||||
// Targets the descriptionKey validation branch of assertI18nLabel (index.ts:96-98),
|
||||
// which the existing index.test.ts never exercises (it only passes a labelKey).
|
||||
describe("assertI18nLabel descriptionKey validation", () => {
|
||||
test("accepts a label whose optional descriptionKey is a valid i18n key", () => {
|
||||
const label = { labelKey: "shell.nav.home", descriptionKey: "shell.nav.home.desc" };
|
||||
expect(assertI18nLabel(label)).toBe(label);
|
||||
});
|
||||
|
||||
test("rejects a non-i18n descriptionKey even when the labelKey is valid", () => {
|
||||
expect(() => assertI18nLabel({ labelKey: "shell.nav.home", descriptionKey: "Plain Text" })).toThrow(
|
||||
/descriptions must use i18n keys/i,
|
||||
);
|
||||
});
|
||||
|
||||
test("error message names the offending descriptionKey", () => {
|
||||
expect(() => assertI18nLabel({ labelKey: "a.b", descriptionKey: "BAD_KEY" })).toThrow(/BAD_KEY/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user