diff options
author | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-05 07:19:48 +0000 |
---|---|---|
committer | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-06 12:58:59 +0000 |
commit | 0dec6c641fc11348f89a12680a087ccda1181f66 (patch) | |
tree | add5914f55801e346dd55eb1a7bacc44f6086f8a /test/shared/SettingData.test.ts | |
parent | b86b4680b6c2a3f0cceefaaf7c2e35417ec555df (diff) |
Make Settings class
Diffstat (limited to 'test/shared/SettingData.test.ts')
-rw-r--r-- | test/shared/SettingData.test.ts | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/test/shared/SettingData.test.ts b/test/shared/SettingData.test.ts index 4391e73..138d768 100644 --- a/test/shared/SettingData.test.ts +++ b/test/shared/SettingData.test.ts @@ -1,12 +1,9 @@ import SettingData, { FormKeymaps, JSONTextSettings, FormSettings, } from '../../src/shared/SettingData'; -import Settings from '../../src/shared/Settings'; +import Settings from '../../src/shared/settings/Settings'; import { expect } from 'chai'; import Keymaps from '../../src/shared/settings/Keymaps'; -import Search from '../../src/shared/settings/Search'; -import Properties from '../../src/shared/settings/Properties'; -import Blacklist from '../../src/shared/settings/Blacklist' describe('shared/SettingData', () => { describe('FormKeymaps', () => { @@ -72,21 +69,21 @@ describe('shared/SettingData', () => { describe('#fromSettings to #toJSON', () => { it('create from a Settings and create a JSON string', () => { - let o = { - keymaps: Keymaps.fromJSON({}), - search: Search.fromJSON({ + let o = Settings.fromJSON({ + keymaps: {}, + search: { default: "google", engines: { google: "https://google.com/search?q={}", }, - }), - properties: Properties.fromJSON({ + }, + properties: { hintchars: "abcdefghijklmnopqrstuvwxyz", smoothscroll: false, complete: "sbh" - }), - blacklist: Blacklist.fromJSON([]), - }; + }, + blacklist: [], + }); let json = JSONTextSettings.fromSettings(o).toJSONText(); expect(JSON.parse(json)).to.deep.equal({ @@ -150,24 +147,24 @@ describe('shared/SettingData', () => { describe('#fromSettings to #toJSON', () => { it('create from a Settings and create a JSON string', () => { - let data: Settings = { - keymaps: Keymaps.fromJSON({ + let data: Settings = Settings.fromJSON({ + keymaps: { 'j': { type: 'scroll.vertically', count: 1 }, '0': { type: 'scroll.home' }, - }), - search: Search.fromJSON({ + }, + search: { default: "google", engines: { "google": "https://google.com/search?q={}" } - }), - properties: Properties.fromJSON({ + }, + properties: { hintchars: "abcdefghijklmnopqrstuvwxyz", smoothscroll: false, complete: "sbh" - }), - blacklist: Blacklist.fromJSON([]), - }; + }, + blacklist: [], + }); let json = FormSettings.fromSettings(data).toJSON(); expect(json).to.deep.equal({ |