Make settings as a clean architecture
This commit is contained in:
parent
e76ca380f7
commit
bacf83a320
16 changed files with 223 additions and 196 deletions
30
test/content/repositories/SettingRepository.test.ts
Normal file
30
test/content/repositories/SettingRepository.test.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { SettingRepositoryImpl } from '../../../src/content/repositories/SettingRepository';
|
||||
import { expect } from 'chai';
|
||||
|
||||
describe('SettingRepositoryImpl', () => {
|
||||
it('updates and gets current value', () => {
|
||||
let sut = new SettingRepositoryImpl();
|
||||
|
||||
let settings = {
|
||||
keymaps: {},
|
||||
search: {
|
||||
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');
|
||||
});
|
||||
});
|
||||
|
Reference in a new issue