Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+13
-13
@@ -5,23 +5,23 @@ import path from "node:path";
|
||||
const repoRoot = process.cwd();
|
||||
|
||||
describe("form detail i18n formatting", () => {
|
||||
it("keeps the form admin allowed-origin placeholder behind a translation key", () => {
|
||||
const source = fs.readFileSync(path.join(repoRoot, "apps/web/app/routes/app.$tenant/forms.tsx"), "utf8");
|
||||
const en = fs.readFileSync(path.join(repoRoot, "apps/web/public/locales/en/translations.json"), "utf8");
|
||||
const de = fs.readFileSync(path.join(repoRoot, "apps/web/public/locales/de/translations.json"), "utf8");
|
||||
it("keeps the form editor UI copy behind translation keys", () => {
|
||||
const editor = fs.readFileSync(path.join(repoRoot, "apps/web/app/components/screens/forms/FormEditorPage.tsx"), "utf8");
|
||||
const responses = fs.readFileSync(path.join(repoRoot, "apps/web/app/components/screens/forms/editor/ResponsesTab.tsx"), "utf8");
|
||||
|
||||
expect(source).toContain('placeholder={t("settings.forms.admin.create.allowedOriginPlaceholder")}');
|
||||
expect(source).not.toContain('placeholder="https://www.example.com"');
|
||||
expect(en).toContain('"allowedOriginPlaceholder": "https://www.example.com"');
|
||||
expect(de).toContain('"allowedOriginPlaceholder": "https://www.example.com"');
|
||||
expect(editor).toContain('t("settings.forms.editor.header.autosave.saved")');
|
||||
expect(editor).toContain('t("settings.forms.editor.tabs.questions")');
|
||||
expect(responses).toContain('t("settings.forms.editor.responses.title")');
|
||||
expect(editor).not.toContain('placeholder="https://www.example.com"');
|
||||
});
|
||||
|
||||
it("formats submission timestamps through locale helpers", () => {
|
||||
const source = fs.readFileSync(path.join(repoRoot, "apps/web/app/routes/app.$tenant/forms.$id.tsx"), "utf8");
|
||||
const route = fs.readFileSync(path.join(repoRoot, "apps/web/app/routes/app.$tenant/forms.$id.tsx"), "utf8");
|
||||
const responses = fs.readFileSync(path.join(repoRoot, "apps/web/app/components/screens/forms/editor/ResponsesTab.tsx"), "utf8");
|
||||
|
||||
expect(source).toContain("useLocaleFormatters");
|
||||
expect(source).toContain("formatters.dateTime(s.createdAt");
|
||||
expect(source).toContain("<time dateTime={s.createdAt}");
|
||||
expect(source).not.toContain("<span>{s.createdAt}</span>");
|
||||
expect(route).toContain("useLocaleFormatters");
|
||||
expect(route).toContain("formatters.dateTime(value");
|
||||
expect(responses).toContain("<time dateTime={submission.createdAt}");
|
||||
expect(responses).toContain("formatDateTime(submission.createdAt)");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user