Make Settings class
This commit is contained in:
parent
b86b4680b6
commit
0dec6c641f
13 changed files with 120 additions and 99 deletions
|
@ -1,27 +1,26 @@
|
|||
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';
|
||||
import Settings from '../../../src/shared/settings/Settings';
|
||||
|
||||
describe('SettingRepositoryImpl', () => {
|
||||
it('updates and gets current value', () => {
|
||||
let sut = new SettingRepositoryImpl();
|
||||
|
||||
let settings = {
|
||||
keymaps: Keymaps.fromJSON({}),
|
||||
search: Search.fromJSON({
|
||||
let settings = Settings.fromJSON({
|
||||
keymaps: {},
|
||||
search:{
|
||||
default: 'google',
|
||||
engines: {
|
||||
google: 'https://google.com/?q={}',
|
||||
}
|
||||
}),
|
||||
},
|
||||
properties: {
|
||||
hintchars: 'abcd1234',
|
||||
smoothscroll: false,
|
||||
complete: 'sbh',
|
||||
},
|
||||
blacklist: [],
|
||||
};
|
||||
});
|
||||
|
||||
sut.set(settings);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import SettingRepository from '../../../src/content/repositories/SettingRepository';
|
||||
import SettingClient from '../../../src/content/client/SettingClient';
|
||||
import SettingUseCase from '../../../src/content/usecases/SettingUseCase';
|
||||
import Settings, { DefaultSetting } from '../../../src/shared/Settings';
|
||||
import Settings, { DefaultSetting } from '../../../src/shared/settings/Settings';
|
||||
import { expect } from 'chai';
|
||||
|
||||
class MockSettingRepository implements SettingRepository {
|
||||
|
|
Reference in a new issue