aboutsummaryrefslogtreecommitdiff
path: root/test/shared/Settings.test.ts
diff options
context:
space:
mode:
authorShin'ya UEOKA <ueokande@i-beam.org>2019-10-05 07:19:48 +0000
committerShin'ya UEOKA <ueokande@i-beam.org>2019-10-06 12:58:59 +0000
commit0dec6c641fc11348f89a12680a087ccda1181f66 (patch)
treeadd5914f55801e346dd55eb1a7bacc44f6086f8a /test/shared/Settings.test.ts
parentb86b4680b6c2a3f0cceefaaf7c2e35417ec555df (diff)
Make Settings class
Diffstat (limited to 'test/shared/Settings.test.ts')
-rw-r--r--test/shared/Settings.test.ts54
1 files changed, 0 insertions, 54 deletions
diff --git a/test/shared/Settings.test.ts b/test/shared/Settings.test.ts
deleted file mode 100644
index 9688798..0000000
--- a/test/shared/Settings.test.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import * as settings from '../../src/shared/Settings';
-import {expect} from 'chai';
-
-describe('Settings', () => {
- describe('#valueOf', () => {
- it('returns settings by valid settings', () => {
- let x = settings.valueOf({
- keymaps: {},
- "search": {
- "default": "google",
- "engines": {
- "google": "https://google.com/search?q={}",
- }
- },
- "properties": {},
- "blacklist": []
- });
-
- expect({
- keymaps: x.keymaps.toJSON(),
- search: x.search.toJSON(),
- properties: x.properties.toJSON(),
- blacklist: x.blacklist.toJSON(),
- }).to.deep.equal({
- keymaps: {},
- search: {
- default: "google",
- engines: {
- google: "https://google.com/search?q={}",
- }
- },
- properties: {
- hintchars: "abcdefghijklmnopqrstuvwxyz",
- smoothscroll: false,
- complete: "sbh"
- },
- blacklist: []
- });
- });
-
- it('sets default settings', () => {
- let value = settings.valueOf({});
- expect(value.keymaps.toJSON()).to.not.be.empty;
- expect(value.properties.toJSON()).to.not.be.empty;
- expect(value.search.defaultEngine).to.be.a('string');
- expect(value.search.engines).to.be.an('object');
- expect(value.blacklist.toJSON()).to.be.empty;
- });
-
- it('throws a TypeError with an unknown field', () => {
- expect(() => settings.valueOf({ name: 'alice' })).to.throw(TypeError)
- });
- });
-});