aboutsummaryrefslogtreecommitdiff
path: root/test/shared/settings
diff options
context:
space:
mode:
authorShin'ya UEOKA <ueokande@i-beam.org>2019-10-05 02:06:02 +0000
committerShin'ya UEOKA <ueokande@i-beam.org>2019-10-06 12:58:59 +0000
commit574692551a27ea56660bf2061daeaa0d34beaff4 (patch)
tree414a7f1de8dfb24af45d7e392b72549bc67ad48a /test/shared/settings
parent2116ac90a6dfdb0910d7ad2896f70a052aa635cc (diff)
Make Properties class
Diffstat (limited to 'test/shared/settings')
-rw-r--r--test/shared/settings/Properties.test.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/shared/settings/Properties.test.ts b/test/shared/settings/Properties.test.ts
new file mode 100644
index 0000000..609a565
--- /dev/null
+++ b/test/shared/settings/Properties.test.ts
@@ -0,0 +1,30 @@
+import Properties from '../../../src/shared/settings/Properties';
+import { expect } from 'chai';
+
+describe('Properties', () => {
+ describe('#propertiesValueOf', () => {
+ it('returns with default properties by empty settings', () => {
+ let props = Properties.fromJSON({});
+ expect(props).to.deep.equal({
+ hintchars: "abcdefghijklmnopqrstuvwxyz",
+ smoothscroll: false,
+ complete: "sbh"
+ })
+ });
+
+ it('returns properties by valid settings', () => {
+ let props = Properties.fromJSON({
+ hintchars: "abcdefgh",
+ smoothscroll: false,
+ complete: "sbh"
+ });
+
+ expect(props).to.deep.equal({
+ hintchars: "abcdefgh",
+ smoothscroll: false,
+ complete: "sbh"
+ });
+ });
+ });
+});
+