ContextMenu_test.res.mjs

 1// Generated by ReScript, PLEASE EDIT WITH CARE
 2
 3import * as Vitest from "vitest";
 4import * as Waypoint from "../src/ffi/Waypoint.res.mjs";
 5
 6Vitest.describe("ContextMenu", () => {
 7  Vitest.test("waypoint content decodes correctly from Waldo result", ctx => {
 8    let waypointContent = {
 9      type: "waypoint",
10      attrs: {
11        id: "test-id",
12        point: [
13          -77.0369,
14          38.9072
15        ],
16        label: "Washington",
17        country: "US",
18        gid: (102191569).toString(),
19        from: undefined,
20        cons: [],
21        nonroutable: false,
22        error: undefined
23      }
24    };
25    let attrs = Waypoint.fromJSON(waypointContent.attrs);
26    if (attrs.TAG === "Ok") {
27      let attrs$1 = attrs._0;
28      ctx.expect(attrs$1.label).toBe("Washington");
29      ctx.expect(attrs$1.country).toBe("US");
30      ctx.expect(attrs$1.gid).toBe("102191569");
31      ctx.expect(attrs$1.point).toEqual([
32        -77.0369,
33        38.9072
34      ]);
35      ctx.expect(attrs$1.cons).toEqual([]);
36      ctx.expect(attrs$1.nonroutable).toBe(false);
37      ctx.expect(attrs$1.error).toEqual(undefined);
38      ctx.expect(attrs$1.from).toEqual(undefined);
39      return;
40    }
41    ctx.fail(`Waypoint decode failed: ` + attrs._0);
42  });
43});
44
45/*  Not a pure module */