diff options
Diffstat (limited to 'test/content/repositories')
9 files changed, 97 insertions, 102 deletions
diff --git a/test/content/repositories/AddonEnabledRepository.test.ts b/test/content/repositories/AddonEnabledRepository.test.ts index 7edd50e..13dff76 100644 --- a/test/content/repositories/AddonEnabledRepository.test.ts +++ b/test/content/repositories/AddonEnabledRepository.test.ts @@ -1,8 +1,8 @@ -import { AddonEnabledRepositoryImpl } from '../../../src/content/repositories/AddonEnabledRepository'; -import { expect } from 'chai'; +import { AddonEnabledRepositoryImpl } from "../../../src/content/repositories/AddonEnabledRepository"; +import { expect } from "chai"; -describe('AddonEnabledRepositoryImpl', () => { - it('updates and gets current value', () => { +describe("AddonEnabledRepositoryImpl", () => { + it("updates and gets current value", () => { const sut = new AddonEnabledRepositoryImpl(); sut.set(true); @@ -12,4 +12,3 @@ describe('AddonEnabledRepositoryImpl', () => { expect(sut.get()).to.be.false; }); }); - diff --git a/test/content/repositories/FindRepository.test.ts b/test/content/repositories/FindRepository.test.ts index 0e50b0a..e0abb9d 100644 --- a/test/content/repositories/FindRepository.test.ts +++ b/test/content/repositories/FindRepository.test.ts @@ -1,15 +1,14 @@ -import { FindRepositoryImpl } from '../../../src/content/repositories/FindRepository'; -import { expect } from 'chai'; +import { FindRepositoryImpl } from "../../../src/content/repositories/FindRepository"; +import { expect } from "chai"; -describe('FindRepositoryImpl', () => { - it('updates and gets last keyword', () => { +describe("FindRepositoryImpl", () => { + it("updates and gets last keyword", () => { const sut = new FindRepositoryImpl(); expect(sut.getLastKeyword()).to.be.null; - sut.setLastKeyword('monkey'); + sut.setLastKeyword("monkey"); - expect(sut.getLastKeyword()).to.equal('monkey'); + expect(sut.getLastKeyword()).to.equal("monkey"); }); }); - diff --git a/test/content/repositories/FollowKeyRepository.test.ts b/test/content/repositories/FollowKeyRepository.test.ts index eae58b9..6608662 100644 --- a/test/content/repositories/FollowKeyRepository.test.ts +++ b/test/content/repositories/FollowKeyRepository.test.ts @@ -1,31 +1,29 @@ -import FollowKeyRepository, { FollowKeyRepositoryImpl } - from '../../../src/content/repositories/FollowKeyRepository'; -import { expect } from 'chai'; +import FollowKeyRepository, { + FollowKeyRepositoryImpl, +} from "../../../src/content/repositories/FollowKeyRepository"; +import { expect } from "chai"; -describe('FollowKeyRepositoryImpl', () => { +describe("FollowKeyRepositoryImpl", () => { let sut: FollowKeyRepository; before(() => { sut = new FollowKeyRepositoryImpl(); }); - describe('#getKeys()/#pushKey()/#popKey()', () => { - it('enqueues keys', () => { + describe("#getKeys()/#pushKey()/#popKey()", () => { + it("enqueues keys", () => { expect(sut.getKeys()).to.be.empty; - sut.pushKey('a'); - sut.pushKey('b'); - sut.pushKey('c'); - expect(sut.getKeys()).to.deep.equal(['a', 'b', 'c']); + sut.pushKey("a"); + sut.pushKey("b"); + sut.pushKey("c"); + expect(sut.getKeys()).to.deep.equal(["a", "b", "c"]); sut.popKey(); - expect(sut.getKeys()).to.deep.equal(['a', 'b']); + expect(sut.getKeys()).to.deep.equal(["a", "b"]); sut.clearKeys(); expect(sut.getKeys()).to.be.empty; }); }); }); - - - diff --git a/test/content/repositories/FollowMasterRepository.test.ts b/test/content/repositories/FollowMasterRepository.test.ts index 3eb172f..9b5e151 100644 --- a/test/content/repositories/FollowMasterRepository.test.ts +++ b/test/content/repositories/FollowMasterRepository.test.ts @@ -1,42 +1,43 @@ -import FollowMasterRepository, { FollowMasterRepositoryImpl } - from '../../../src/content/repositories/FollowMasterRepository'; -import { expect } from 'chai'; +import FollowMasterRepository, { + FollowMasterRepositoryImpl, +} from "../../../src/content/repositories/FollowMasterRepository"; +import { expect } from "chai"; -describe('FollowMasterRepositoryImpl', () => { +describe("FollowMasterRepositoryImpl", () => { let sut: FollowMasterRepository; before(() => { sut = new FollowMasterRepositoryImpl(); }); - describe('#getTags()/#addTag()/#clearTags()', () => { - it('gets, adds and clears tags', () => { + describe("#getTags()/#addTag()/#clearTags()", () => { + it("gets, adds and clears tags", () => { expect(sut.getTags()).to.be.empty; - sut.addTag('a'); - sut.addTag('b'); - sut.addTag('c'); - expect(sut.getTags()).to.deep.equal(['a', 'b', 'c']); + sut.addTag("a"); + sut.addTag("b"); + sut.addTag("c"); + expect(sut.getTags()).to.deep.equal(["a", "b", "c"]); sut.clearTags(); expect(sut.getTags()).to.be.empty; }); }); - describe('#getTagsByPrefix', () => { - it('gets tags matched by prefix', () => { - for (const tag of ['a', 'aa', 'ab', 'b', 'ba', 'bb']) { + describe("#getTagsByPrefix", () => { + it("gets tags matched by prefix", () => { + for (const tag of ["a", "aa", "ab", "b", "ba", "bb"]) { sut.addTag(tag); } - expect(sut.getTagsByPrefix('a')).to.deep.equal(['a', 'aa', 'ab']); - expect(sut.getTagsByPrefix('aa')).to.deep.equal(['aa']); - expect(sut.getTagsByPrefix('b')).to.deep.equal(['b', 'ba', 'bb']); - expect(sut.getTagsByPrefix('c')).to.be.empty; + expect(sut.getTagsByPrefix("a")).to.deep.equal(["a", "aa", "ab"]); + expect(sut.getTagsByPrefix("aa")).to.deep.equal(["aa"]); + expect(sut.getTagsByPrefix("b")).to.deep.equal(["b", "ba", "bb"]); + expect(sut.getTagsByPrefix("c")).to.be.empty; }); }); - describe('#setCurrentFollowMode()/#getCurrentNewTabMode()/#getCurrentBackgroundMode', () => { - it('updates and gets follow mode', () => { + describe("#setCurrentFollowMode()/#getCurrentNewTabMode()/#getCurrentBackgroundMode", () => { + it("updates and gets follow mode", () => { sut.setCurrentFollowMode(false, true); expect(sut.getCurrentNewTabMode()).to.be.false; expect(sut.getCurrentBackgroundMode()).to.be.true; diff --git a/test/content/repositories/FollowSlaveRepository.test.ts b/test/content/repositories/FollowSlaveRepository.test.ts index 10cf094..0f829b2 100644 --- a/test/content/repositories/FollowSlaveRepository.test.ts +++ b/test/content/repositories/FollowSlaveRepository.test.ts @@ -1,16 +1,17 @@ -import FollowSlaveRepository, { FollowSlaveRepositoryImpl } - from '../../../src/content/repositories/FollowSlaveRepository'; -import { expect } from 'chai'; +import FollowSlaveRepository, { + FollowSlaveRepositoryImpl, +} from "../../../src/content/repositories/FollowSlaveRepository"; +import { expect } from "chai"; -describe('FollowSlaveRepository', () => { +describe("FollowSlaveRepository", () => { let sut: FollowSlaveRepository; before(() => { sut = new FollowSlaveRepositoryImpl(); }); - describe('#isFollowMode()/#enableFollowMode()/#disableFollowMode()', () => { - it('gets, adds updates follow mode', () => { + describe("#isFollowMode()/#enableFollowMode()/#disableFollowMode()", () => { + it("gets, adds updates follow mode", () => { expect(sut.isFollowMode()).to.be.false; sut.enableFollowMode(); @@ -21,4 +22,3 @@ describe('FollowSlaveRepository', () => { }); }); }); - diff --git a/test/content/repositories/KeymapRepository.test.ts b/test/content/repositories/KeymapRepository.test.ts index 68f515c..0e01a73 100644 --- a/test/content/repositories/KeymapRepository.test.ts +++ b/test/content/repositories/KeymapRepository.test.ts @@ -1,39 +1,38 @@ -import KeymapRepository, { KeymapRepositoryImpl } - from '../../../src/content/repositories/KeymapRepository'; -import { expect } from 'chai'; +import KeymapRepository, { + KeymapRepositoryImpl, +} from "../../../src/content/repositories/KeymapRepository"; +import { expect } from "chai"; import Key from "../../../src/shared/settings/Key"; -describe('KeymapRepositoryImpl', () => { +describe("KeymapRepositoryImpl", () => { let sut: KeymapRepository; before(() => { sut = new KeymapRepositoryImpl(); }); - describe('#enqueueKey()', () => { - it('enqueues keys', () => { - sut.enqueueKey(Key.fromMapKey('a')); - sut.enqueueKey(Key.fromMapKey('b')); - const sequence = sut.enqueueKey(Key.fromMapKey('c')); + describe("#enqueueKey()", () => { + it("enqueues keys", () => { + sut.enqueueKey(Key.fromMapKey("a")); + sut.enqueueKey(Key.fromMapKey("b")); + const sequence = sut.enqueueKey(Key.fromMapKey("c")); const keys = sequence.keys; - expect(keys[0].equals(Key.fromMapKey('a'))).to.be.true; - expect(keys[1].equals(Key.fromMapKey('b'))).to.be.true; - expect(keys[2].equals(Key.fromMapKey('c'))).to.be.true; + expect(keys[0].equals(Key.fromMapKey("a"))).to.be.true; + expect(keys[1].equals(Key.fromMapKey("b"))).to.be.true; + expect(keys[2].equals(Key.fromMapKey("c"))).to.be.true; }); }); - describe('#clear()', () => { - it('clears keys', () => { - sut.enqueueKey(Key.fromMapKey('a')); - sut.enqueueKey(Key.fromMapKey('b')); - sut.enqueueKey(Key.fromMapKey('c')); + describe("#clear()", () => { + it("clears keys", () => { + sut.enqueueKey(Key.fromMapKey("a")); + sut.enqueueKey(Key.fromMapKey("b")); + sut.enqueueKey(Key.fromMapKey("c")); sut.clear(); - const sequence = sut.enqueueKey(Key.fromMapKey('a')); + const sequence = sut.enqueueKey(Key.fromMapKey("a")); expect(sequence.length()).to.equal(1); }); }); }); - - diff --git a/test/content/repositories/MarkKeyRepository.test.ts b/test/content/repositories/MarkKeyRepository.test.ts index 8592332..473b4dc 100644 --- a/test/content/repositories/MarkKeyRepository.test.ts +++ b/test/content/repositories/MarkKeyRepository.test.ts @@ -1,16 +1,17 @@ -import MarkRepository, { MarkKeyRepositoryImpl } - from '../../../src/content/repositories/MarkKeyRepository'; -import { expect } from 'chai'; +import MarkRepository, { + MarkKeyRepositoryImpl, +} from "../../../src/content/repositories/MarkKeyRepository"; +import { expect } from "chai"; -describe('MarkKeyRepositoryImpl', () => { +describe("MarkKeyRepositoryImpl", () => { let sut: MarkRepository; before(() => { sut = new MarkKeyRepositoryImpl(); - }) + }); - describe('#isSetMode/#enableSetMode/#disabeSetMode', () => { - it('enables and disables set mode', () => { + describe("#isSetMode/#enableSetMode/#disabeSetMode", () => { + it("enables and disables set mode", () => { expect(sut.isSetMode()).to.be.false; sut.enableSetMode(); @@ -21,8 +22,8 @@ describe('MarkKeyRepositoryImpl', () => { }); }); - describe('#isJumpMode/#enableJumpMode/#disabeJumpMode', () => { - it('enables and disables jump mode', () => { + describe("#isJumpMode/#enableJumpMode/#disabeJumpMode", () => { + it("enables and disables jump mode", () => { expect(sut.isJumpMode()).to.be.false; sut.enableJumpMode(); @@ -33,4 +34,3 @@ describe('MarkKeyRepositoryImpl', () => { }); }); }); - diff --git a/test/content/repositories/MarkRepository.test.ts b/test/content/repositories/MarkRepository.test.ts index 6ddd38d..f2a7326 100644 --- a/test/content/repositories/MarkRepository.test.ts +++ b/test/content/repositories/MarkRepository.test.ts @@ -1,13 +1,12 @@ -import { MarkRepositoryImpl } from '../../../src/content/repositories/MarkRepository'; -import { expect } from 'chai'; +import { MarkRepositoryImpl } from "../../../src/content/repositories/MarkRepository"; +import { expect } from "chai"; -describe('MarkRepositoryImpl', () => { - it('save and load marks', () => { +describe("MarkRepositoryImpl", () => { + it("save and load marks", () => { const sut = new MarkRepositoryImpl(); - sut.set('a', { x: 10, y: 20 }); - expect(sut.get('a')).to.deep.equal({ x: 10, y: 20 }); - expect(sut.get('b')).to.be.null; + sut.set("a", { x: 10, y: 20 }); + expect(sut.get("a")).to.deep.equal({ x: 10, y: 20 }); + expect(sut.get("b")).to.be.null; }); }); - diff --git a/test/content/repositories/SettingRepository.test.ts b/test/content/repositories/SettingRepository.test.ts index e45d7c4..99247a9 100644 --- a/test/content/repositories/SettingRepository.test.ts +++ b/test/content/repositories/SettingRepository.test.ts @@ -1,23 +1,23 @@ -import { SettingRepositoryImpl } from '../../../src/content/repositories/SettingRepository'; -import { expect } from 'chai'; -import Settings from '../../../src/shared/settings/Settings'; +import { SettingRepositoryImpl } from "../../../src/content/repositories/SettingRepository"; +import { expect } from "chai"; +import Settings from "../../../src/shared/settings/Settings"; -describe('SettingRepositoryImpl', () => { - it('updates and gets current value', () => { +describe("SettingRepositoryImpl", () => { + it("updates and gets current value", () => { const sut = new SettingRepositoryImpl(); const settings = Settings.fromJSON({ keymaps: {}, - search:{ - default: 'google', + search: { + default: "google", engines: { - google: 'https://google.com/?q={}', - } + google: "https://google.com/?q={}", + }, }, properties: { - hintchars: 'abcd1234', + hintchars: "abcd1234", smoothscroll: false, - complete: 'sbh', + complete: "sbh", }, blacklist: [], }); @@ -25,6 +25,6 @@ describe('SettingRepositoryImpl', () => { sut.set(settings); const actual = sut.get(); - expect(actual.properties.hintchars).to.equal('abcd1234'); + expect(actual.properties.hintchars).to.equal("abcd1234"); }); }); |