aboutsummaryrefslogtreecommitdiff
path: root/test/content/repositories
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-11 08:04:01 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-11 08:04:01 +0900
commitbacf83a32083c5a4c4a45c061288081423bbf18a (patch)
treef5a73e2b989428ca3f3466b6e4a4cc744e24f4b7 /test/content/repositories
parente76ca380f733b515c31297a285d8bea44e074a1b (diff)
Make settings as a clean architecture
Diffstat (limited to 'test/content/repositories')
-rw-r--r--test/content/repositories/SettingRepository.test.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/content/repositories/SettingRepository.test.ts b/test/content/repositories/SettingRepository.test.ts
new file mode 100644
index 0000000..fea70b7
--- /dev/null
+++ b/test/content/repositories/SettingRepository.test.ts
@@ -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');
+ });
+});
+