aboutsummaryrefslogtreecommitdiff
path: root/test/content/repositories/SettingRepository.test.ts
blob: 363fcec078f42f38d56b041ef7edc505faa2fc41 (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
import { SettingRepositoryImpl } from '../../../src/content/repositories/SettingRepository';
import { expect } from 'chai';
import Keymaps from '../../../src/shared/settings/Keymaps';
import Search from '../../../src/shared/settings/Search';

describe('SettingRepositoryImpl', () => {
  it('updates and gets current value', () => {
    let sut = new SettingRepositoryImpl();

    let settings = {
      keymaps: Keymaps.fromJSON({}),
      search: Search.fromJSON({
        default: 'google',
        engines: {
          google: 'https://google.com/?q={}',
        }
      }),
      properties: {
        hintchars: 'abcd1234',
        smoothscroll: false,
        complete: 'sbh',
      },
      blacklist: [],
    };

    sut.set(settings);

    let actual = sut.get();
    expect(actual.properties.hintchars).to.equal('abcd1234');
  });
});