reboot alterflixhub
This commit is contained in:
commit
1e84023a44
188 files changed
+31629
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { LOCALES, MESSAGES, translate } from "@/lib/i18n/messages";
|
||||
import { CINEMA_CATEGORIES } from "@/lib/cinemas";
|
||||
|
||||
describe("i18n messages", () => {
|
||||
it("มีข้อความครบทุก locale", () => {
|
||||
for (const locale of LOCALES) {
|
||||
const messages = MESSAGES[locale];
|
||||
expect(messages.hero.titleSuffix.length).toBeGreaterThan(0);
|
||||
expect(messages.list.title.length).toBeGreaterThan(0);
|
||||
expect(messages.detail.otherCinemas.length).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
|
||||
it("แปลป้ายได้ครบทุกหมวดหมู่ที่ใช้กรอง", () => {
|
||||
for (const locale of LOCALES) {
|
||||
for (const category of CINEMA_CATEGORIES) {
|
||||
expect(MESSAGES[locale].categories[category]).toBeTruthy();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("ภาษาอังกฤษต่างจากไทยในข้อความหลัก", () => {
|
||||
expect(MESSAGES.en.list.title).not.toBe(MESSAGES.th.list.title);
|
||||
expect(MESSAGES.en.search.submit).not.toBe(MESSAGES.th.search.submit);
|
||||
});
|
||||
|
||||
it("ค่าที่ไม่รู้จักถูกส่งกลับตามเดิม", () => {
|
||||
expect(translate(MESSAGES.en.tags, "tag-ใหม่")).toBe("tag-ใหม่");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user