Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
+27
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import fs from "node:fs";
|
||||
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");
|
||||
|
||||
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"');
|
||||
});
|
||||
|
||||
it("formats submission timestamps through locale helpers", () => {
|
||||
const source = fs.readFileSync(path.join(repoRoot, "apps/web/app/routes/app.$tenant/forms.$id.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>");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user