mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-03 20:30:33 -06:00
Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com> Co-authored-by: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Co-authored-by: Victor Hugo dos Santos <115753265+victorvhs017@users.noreply.github.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com> Co-authored-by: Matti Nannt <matti@formbricks.com> Co-authored-by: Matti Nannt <mail@matthiasnannt.com> Co-authored-by: Johannes <johannes@formbricks.com> Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
26 lines
737 B
TypeScript
26 lines
737 B
TypeScript
import { describe, expect, test, vi } from "vitest";
|
|
import { getLocale } from "@/lingodotdev/language";
|
|
import { getTranslate } from "./server";
|
|
|
|
vi.mock("@/lingodotdev/language", () => ({
|
|
getLocale: vi.fn(),
|
|
}));
|
|
|
|
vi.mock("@/lingodotdev/shared", () => ({
|
|
DEFAULT_LANGUAGE: "en-US",
|
|
}));
|
|
|
|
describe("lingodotdev server", () => {
|
|
test("should get translate", async () => {
|
|
vi.mocked(getLocale).mockResolvedValue("en-US");
|
|
const translate = await getTranslate();
|
|
expect(translate).toBeDefined();
|
|
});
|
|
|
|
test("should get translate with default locale", async () => {
|
|
vi.mocked(getLocale).mockResolvedValue(undefined as any);
|
|
const translate = await getTranslate();
|
|
expect(translate).toBeDefined();
|
|
});
|
|
});
|