diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/content/usecases/AddonEnabledUseCase.test.ts | 2 | ||||
-rw-r--r-- | test/content/usecases/ClipboardUseCase.test.ts | 8 | ||||
-rw-r--r-- | test/content/usecases/FindUseCase.test.ts | 2 | ||||
-rw-r--r-- | test/content/usecases/MarkUseCase.test.ts | 11 | ||||
-rw-r--r-- | test/content/usecases/SettingUseCaase.test.ts | 2 | ||||
-rw-r--r-- | test/main.ts | 6 |
6 files changed, 22 insertions, 9 deletions
diff --git a/test/content/usecases/AddonEnabledUseCase.test.ts b/test/content/usecases/AddonEnabledUseCase.test.ts index 912bddf..8c15099 100644 --- a/test/content/usecases/AddonEnabledUseCase.test.ts +++ b/test/content/usecases/AddonEnabledUseCase.test.ts @@ -40,7 +40,7 @@ describe('AddonEnabledUseCase', () => { beforeEach(() => { repository = new MockAddonEnabledRepository(true); indicator = new MockAddonIndicatorClient(false); - sut = new AddonEnabledUseCase({ repository, indicator }); + sut = new AddonEnabledUseCase(indicator, repository); }); describe('#enable', () => { diff --git a/test/content/usecases/ClipboardUseCase.test.ts b/test/content/usecases/ClipboardUseCase.test.ts index 862ee8a..551c3f7 100644 --- a/test/content/usecases/ClipboardUseCase.test.ts +++ b/test/content/usecases/ClipboardUseCase.test.ts @@ -1,4 +1,5 @@ import ClipboardRepository from '../../../src/content/repositories/ClipboardRepository'; +import { SettingRepositoryImpl } from '../../../src/content/repositories/SettingRepository'; import TabsClient from '../../../src/content/client/TabsClient'; import MockConsoleClient from '../mock/MockConsoleClient'; import ClipboardUseCase from '../../../src/content/usecases/ClipboardUseCase'; @@ -43,7 +44,12 @@ describe('ClipboardUseCase', () => { repository = new MockClipboardRepository(); client = new MockTabsClient(); consoleClient = new MockConsoleClient(); - sut = new ClipboardUseCase({ repository, client: client, consoleClient }); + sut = new ClipboardUseCase( + repository, + new SettingRepositoryImpl(), + client, + consoleClient + ); }); describe('#yankCurrentURL', () => { diff --git a/test/content/usecases/FindUseCase.test.ts b/test/content/usecases/FindUseCase.test.ts index c7bfd39..ddd4cd4 100644 --- a/test/content/usecases/FindUseCase.test.ts +++ b/test/content/usecases/FindUseCase.test.ts @@ -71,7 +71,7 @@ describe('FindUseCase', () => { presenter = new MockFindPresenter(); client = new MockFindClient(); consoleClient = new MockConsoleClient(); - sut = new FindUseCase({ repository, presenter, client, consoleClient }); + sut = new FindUseCase(presenter, repository, client, consoleClient); }); describe('#startFind', () => { diff --git a/test/content/usecases/MarkUseCase.test.ts b/test/content/usecases/MarkUseCase.test.ts index 4f2dee4..494497a 100644 --- a/test/content/usecases/MarkUseCase.test.ts +++ b/test/content/usecases/MarkUseCase.test.ts @@ -1,4 +1,5 @@ import MarkRepository from '../../../src/content/repositories/MarkRepository'; +import { SettingRepositoryImpl } from '../../../src/content/repositories/SettingRepository'; import MarkUseCase from '../../../src/content/usecases/MarkUseCase'; import MarkClient from '../../../src/content/client/MarkClient'; import MockConsoleClient from '../mock/MockConsoleClient'; @@ -54,9 +55,13 @@ describe('MarkUseCase', () => { client = new MockMarkClient(); consoleClient = new MockConsoleClient(); scrollPresenter = new MockScrollPresenter(); - sut = new MarkUseCase({ - repository, client, consoleClient, scrollPresenter, - }); + sut = new MarkUseCase( + scrollPresenter, + client, + repository, + new SettingRepositoryImpl(), + consoleClient, + ); }); describe('#set', () => { diff --git a/test/content/usecases/SettingUseCaase.test.ts b/test/content/usecases/SettingUseCaase.test.ts index 02cef78..e9633f4 100644 --- a/test/content/usecases/SettingUseCaase.test.ts +++ b/test/content/usecases/SettingUseCaase.test.ts @@ -56,7 +56,7 @@ describe('AddonEnabledUseCase', () => { repository = new MockSettingRepository(); client = new MockSettingClient(testSettings); - sut = new SettingUseCase({ repository, client }); + sut = new SettingUseCase(repository, client); }); describe('#reload', () => { diff --git a/test/main.ts b/test/main.ts index 3aeae69..433b531 100644 --- a/test/main.ts +++ b/test/main.ts @@ -1,6 +1,8 @@ -import chai from 'chai'; +import 'reflect-metadata'; +import { expect } from 'chai'; + const browserFake = require('webextensions-api-fake'); const browser = browserFake(); -global.expect = chai.expect; +global.expect = expect; global.browser = browser; |