e2e/tests/5.setting.test.ts (view raw)
1import { SETTING_EN, SETTING_FR } from "../constants";
2import { sdk } from "../lib/gqlSdk";
3
4test("settings are returned in french", async () => {
5 const request = sdk.setting({ locale: "fr-CH" });
6
7 await expect(request).resolves.toMatchObject({
8 setting: {
9 data: {
10 id: expect.stringMatching(/\d/),
11 attributes: SETTING_FR,
12 },
13 },
14 });
15});
16
17test("settings are returned in english", async () => {
18 const request = sdk.setting({ locale: "en" });
19
20 await expect(request).resolves.toMatchObject({
21 setting: {
22 data: {
23 id: expect.stringMatching(/\d/),
24 attributes: SETTING_EN,
25 },
26 },
27 });
28});