diff options
Diffstat (limited to 'test/content/usecases')
-rw-r--r-- | test/content/usecases/ClipboardUseCase.test.ts | 18 | ||||
-rw-r--r-- | test/content/usecases/FindUseCase.test.ts | 2 | ||||
-rw-r--r-- | test/content/usecases/HintKeyProducer.test.ts | 6 | ||||
-rw-r--r-- | test/content/usecases/KeymapUseCase.test.ts | 10 | ||||
-rw-r--r-- | test/content/usecases/SettingUseCaase.test.ts | 6 |
5 files changed, 21 insertions, 21 deletions
diff --git a/test/content/usecases/ClipboardUseCase.test.ts b/test/content/usecases/ClipboardUseCase.test.ts index a863651..2e711c6 100644 --- a/test/content/usecases/ClipboardUseCase.test.ts +++ b/test/content/usecases/ClipboardUseCase.test.ts @@ -14,7 +14,7 @@ describe('ClipboardUseCase', () => { let sut: ClipboardUseCase; beforeEach(() => { - var modal = <ConsoleClient>{}; + const modal = <ConsoleClient>{}; clipboardRepository = <ClipboardRepository>{ read() {}, write(_) {} }; operationClient = <OperationClient>{ internalOpenUrl(_) {} }; @@ -29,13 +29,13 @@ describe('ClipboardUseCase', () => { describe('#yankCurrentURL', () => { it('yanks current url', async () => { - let href = window.location.href; - var mockRepository = sinon.mock(clipboardRepository); + const href = window.location.href; + const mockRepository = sinon.mock(clipboardRepository); mockRepository.expects('write').withArgs(href); - var mockConsoleClient = sinon.mock(consoleClient); + const mockConsoleClient = sinon.mock(consoleClient); mockConsoleClient.expects('info').withArgs('Yanked ' + href); - let yanked = await sut.yankCurrentURL(); + const yanked = await sut.yankCurrentURL(); expect(yanked).to.equal(href); mockRepository.verify(); @@ -45,9 +45,9 @@ describe('ClipboardUseCase', () => { describe('#openOrSearch', () => { it('opens url from the clipboard', async () => { - let url = 'https://github.com/ueokande/vim-vixen' + const url = 'https://github.com/ueokande/vim-vixen' sinon.stub(clipboardRepository, 'read').returns(url); - let mockOperationClient = sinon.mock(operationClient); + const mockOperationClient = sinon.mock(operationClient); mockOperationClient.expects('internalOpenUrl').withArgs(url, true); await sut.openOrSearch(true); @@ -56,9 +56,9 @@ describe('ClipboardUseCase', () => { }); it('opens search results from the clipboard', async () => { - let url = 'https://google.com/search?q=banana'; + const url = 'https://google.com/search?q=banana'; sinon.stub(clipboardRepository, 'read').returns('banana'); - let mockOperationClient = sinon.mock(operationClient); + const mockOperationClient = sinon.mock(operationClient); mockOperationClient.expects('internalOpenUrl').withArgs(url, true); await sut.openOrSearch(true); diff --git a/test/content/usecases/FindUseCase.test.ts b/test/content/usecases/FindUseCase.test.ts index ddd4cd4..3978dbc 100644 --- a/test/content/usecases/FindUseCase.test.ts +++ b/test/content/usecases/FindUseCase.test.ts @@ -32,7 +32,7 @@ class MockFindPresenter implements FindPresenter { } find(keyword: string, _backward: boolean): boolean { - let found = this.document.includes(keyword); + const found = this.document.includes(keyword); this.highlighted = found; return found; } diff --git a/test/content/usecases/HintKeyProducer.test.ts b/test/content/usecases/HintKeyProducer.test.ts index feafffb..5841ae9 100644 --- a/test/content/usecases/HintKeyProducer.test.ts +++ b/test/content/usecases/HintKeyProducer.test.ts @@ -10,13 +10,13 @@ describe('HintKeyProducer class', () => { describe('#produce', () => { it('produce incremented keys', () => { - let charset = 'abc'; - let sequences = [ + const charset = 'abc'; + const sequences = [ 'a', 'b', 'c', 'aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 'cb', 'cc', 'aaa', 'aab', 'aac', 'aba'] - let producer = new HintKeyProducer(charset); + const producer = new HintKeyProducer(charset); for (let i = 0; i < sequences.length; ++i) { expect(producer.produce()).to.equal(sequences[i]); } diff --git a/test/content/usecases/KeymapUseCase.test.ts b/test/content/usecases/KeymapUseCase.test.ts index 598d5a3..032d4fc 100644 --- a/test/content/usecases/KeymapUseCase.test.ts +++ b/test/content/usecases/KeymapUseCase.test.ts @@ -52,7 +52,7 @@ class MockAddressRepository implements AddressRepository { describe('KeymapUseCase', () => { context('with no-digis keymaps', () => { - let settings = Settings.fromJSON({ + const settings = Settings.fromJSON({ keymaps: { k: {type: 'scroll.vertically', count: -1}, j: {type: 'scroll.vertically', count: 1}, @@ -88,7 +88,7 @@ describe('KeymapUseCase', () => { }); context('when keymaps containing numeric mappings', () => { - let settings = Settings.fromJSON({ + const settings = Settings.fromJSON({ keymaps: { 20: {type: "scroll.top"}, g5: {type: 'scroll.bottom'}, @@ -132,7 +132,7 @@ describe('KeymapUseCase', () => { }); context('when the keys are mismatched with the operations', () => { - let settings = Settings.fromJSON({ + const settings = Settings.fromJSON({ keymaps: { gg: {type: "scroll.top"}, G: {type: "scroll.bottom"}, @@ -170,7 +170,7 @@ describe('KeymapUseCase', () => { }); context('when the site matches to the blacklist', () => { - let settings = Settings.fromJSON({ + const settings = Settings.fromJSON({ keymaps: { k: {type: 'scroll.vertically', count: -1}, a: {type: 'addon.enable'}, @@ -197,7 +197,7 @@ describe('KeymapUseCase', () => { }); context('when the site matches to the partial blacklist', () => { - let settings = Settings.fromJSON({ + const settings = Settings.fromJSON({ keymaps: { k: {type: 'scroll.vertically', count: -1}, j: {type: 'scroll.vertically', count: 1}, diff --git a/test/content/usecases/SettingUseCaase.test.ts b/test/content/usecases/SettingUseCaase.test.ts index 136c5af..cf14e6e 100644 --- a/test/content/usecases/SettingUseCaase.test.ts +++ b/test/content/usecases/SettingUseCaase.test.ts @@ -38,7 +38,7 @@ describe('AddonEnabledUseCase', () => { let sut: SettingUseCase; beforeEach(() => { - let testSettings = { + const testSettings = { keymaps: {}, search: { default: 'google', @@ -61,10 +61,10 @@ describe('AddonEnabledUseCase', () => { describe('#reload', () => { it('loads settings and store to repository', async() => { - let settings = await sut.reload(); + const settings = await sut.reload(); expect(settings.properties.hintchars).to.equal('abcd1234'); - let saved = repository.get(); + const saved = repository.get(); expect(saved.properties.hintchars).to.equal('abcd1234'); }); }); |