aboutsummaryrefslogtreecommitdiff
path: root/test/shared/settings/Properties.test.ts
blob: 1161b488d07af997f30768815dcf89fba0e4cd84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Properties from "../../../src/shared/settings/Properties";
import ColorScheme from "../../../src/shared/ColorScheme";

describe("Properties", () => {
  describe("#propertiesValueOf", () => {
    it("returns with default properties by empty settings", () => {
      const props = Properties.fromJSON({});
      expect(props).toEqual({
        hintchars: "abcdefghijklmnopqrstuvwxyz",
        smoothscroll: false,
        complete: "sbh",
        colorscheme: "system",
      });
    });

    it("returns properties by valid settings", () => {
      const props = Properties.fromJSON({
        hintchars: "abcdefgh",
        smoothscroll: false,
        complete: "sbh",
        colorscheme: ColorScheme.System,
      });

      expect(props).toEqual({
        hintchars: "abcdefgh",
        smoothscroll: false,
        complete: "sbh",
        colorscheme: "system",
      });
    });
  });
});