aboutsummaryrefslogtreecommitdiff
path: root/test/content/usecases
diff options
context:
space:
mode:
Diffstat (limited to 'test/content/usecases')
-rw-r--r--test/content/usecases/AddonEnabledUseCase.test.ts31
-rw-r--r--test/content/usecases/FindUseCase.test.ts160
-rw-r--r--test/content/usecases/HintKeyProducer.test.ts13
-rw-r--r--test/content/usecases/KeymapUseCase.test.ts107
-rw-r--r--test/content/usecases/MarkUseCase.test.ts15
-rw-r--r--test/content/usecases/SettingUseCaase.test.ts5
6 files changed, 83 insertions, 248 deletions
diff --git a/test/content/usecases/AddonEnabledUseCase.test.ts b/test/content/usecases/AddonEnabledUseCase.test.ts
index 8a614c5..3d4d667 100644
--- a/test/content/usecases/AddonEnabledUseCase.test.ts
+++ b/test/content/usecases/AddonEnabledUseCase.test.ts
@@ -1,7 +1,6 @@
import AddonEnabledRepository from "../../../src/content/repositories/AddonEnabledRepository";
import AddonEnabledUseCase from "../../../src/content/usecases/AddonEnabledUseCase";
import AddonIndicatorClient from "../../../src/content/client/AddonIndicatorClient";
-import { expect } from "chai";
import MockConsoleFramePresenter from "../operators/impls/MockConsoleFramePresenter";
class MockAddonEnabledRepository implements AddonEnabledRepository {
@@ -50,19 +49,19 @@ describe("AddonEnabledUseCase", () => {
it("store and indicate as enabled", async () => {
await sut.enable();
- expect(repository.get()).to.be.true;
- expect(indicator.enabled).to.be.true;
- expect(presenter.attached).to.be.true;
+ expect(repository.get()).toBeTruthy;
+ expect(indicator.enabled).toBeTruthy;
+ expect(presenter.attached).toBeTruthy;
});
});
- describe("#disable", async () => {
+ describe("#disable", () => {
it("store and indicate as disabled", async () => {
await sut.disable();
- expect(repository.get()).to.be.false;
- expect(indicator.enabled).to.be.false;
- expect(presenter.attached).to.be.false;
+ expect(repository.get()).toBeFalsy;
+ expect(indicator.enabled).toBeFalsy;
+ expect(presenter.attached).toBeFalsy;
});
});
@@ -71,27 +70,27 @@ describe("AddonEnabledUseCase", () => {
repository.set(true);
await sut.toggle();
- expect(repository.get()).to.be.false;
- expect(indicator.enabled).to.be.false;
- expect(presenter.attached).to.be.false;
+ expect(repository.get()).toBeFalsy;
+ expect(indicator.enabled).toBeFalsy;
+ expect(presenter.attached).toBeFalsy;
repository.set(false);
await sut.toggle();
- expect(repository.get()).to.be.true;
- expect(indicator.enabled).to.be.true;
- expect(presenter.attached).to.be.true;
+ expect(repository.get()).toBeTruthy;
+ expect(indicator.enabled).toBeTruthy;
+ expect(presenter.attached).toBeTruthy;
});
});
describe("#getEnabled", () => {
it("returns current addon enabled", () => {
repository.set(true);
- expect(sut.getEnabled()).to.be.true;
+ expect(sut.getEnabled()).toBeTruthy;
repository.set(false);
- expect(sut.getEnabled()).to.be.false;
+ expect(sut.getEnabled()).toBeFalsy;
});
});
});
diff --git a/test/content/usecases/FindUseCase.test.ts b/test/content/usecases/FindUseCase.test.ts
deleted file mode 100644
index b53ef74..0000000
--- a/test/content/usecases/FindUseCase.test.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-import FindRepository from "../../../src/content/repositories/FindRepository";
-import FindPresenter from "../../../src/content/presenters/FindPresenter";
-import FindClient from "../../../src/content/client/FindClient";
-import FindUseCase from "../../../src/content/usecases/FindUseCase";
-import MockConsoleClient from "../mock/MockConsoleClient";
-import { expect } from "chai";
-
-class MockFindRepository implements FindRepository {
- public keyword: string | null;
-
- constructor() {
- this.keyword = null;
- }
-
- getLastKeyword(): string | null {
- return this.keyword;
- }
-
- setLastKeyword(keyword: string): void {
- this.keyword = keyword;
- }
-}
-
-class MockFindPresenter implements FindPresenter {
- public document: string;
-
- public highlighted: boolean;
-
- constructor() {
- this.document = "";
- this.highlighted = false;
- }
-
- find(keyword: string, _backward: boolean): boolean {
- const found = this.document.includes(keyword);
- this.highlighted = found;
- return found;
- }
-
- clearSelection(): void {
- this.highlighted = false;
- }
-}
-
-class MockFindClient implements FindClient {
- public keyword: string | null;
-
- constructor() {
- this.keyword = null;
- }
-
- getGlobalLastKeyword(): Promise<string | null> {
- return Promise.resolve(this.keyword);
- }
-
- setGlobalLastKeyword(keyword: string): Promise<void> {
- this.keyword = keyword;
- return Promise.resolve();
- }
-}
-
-describe("FindUseCase", () => {
- let repository: MockFindRepository;
- let presenter: MockFindPresenter;
- let client: MockFindClient;
- let consoleClient: MockConsoleClient;
- let sut: FindUseCase;
-
- beforeEach(() => {
- repository = new MockFindRepository();
- presenter = new MockFindPresenter();
- client = new MockFindClient();
- consoleClient = new MockConsoleClient();
- sut = new FindUseCase(presenter, repository, client, consoleClient);
- });
-
- describe("#startFind", () => {
- it("find next by ketword", async () => {
- presenter.document = "monkey punch";
-
- await sut.startFind("monkey");
-
- expect(await presenter.highlighted).to.be.true;
- expect(await consoleClient.text).to.equal("Pattern found: monkey");
- expect(await repository.getLastKeyword()).to.equal("monkey");
- expect(await client.getGlobalLastKeyword()).to.equal("monkey");
- });
-
- it("find next by last keyword", async () => {
- presenter.document = "gorilla kick";
- repository.keyword = "gorilla";
-
- await sut.startFind(undefined);
-
- expect(await presenter.highlighted).to.be.true;
- expect(await consoleClient.text).to.equal("Pattern found: gorilla");
- expect(await repository.getLastKeyword()).to.equal("gorilla");
- expect(await client.getGlobalLastKeyword()).to.equal("gorilla");
- });
-
- it("find next by global last keyword", async () => {
- presenter.document = "chimpanzee typing";
-
- repository.keyword = null;
- client.keyword = "chimpanzee";
-
- await sut.startFind(undefined);
-
- expect(await presenter.highlighted).to.be.true;
- expect(await consoleClient.text).to.equal("Pattern found: chimpanzee");
- expect(await repository.getLastKeyword()).to.equal("chimpanzee");
- expect(await client.getGlobalLastKeyword()).to.equal("chimpanzee");
- });
-
- it("find not found error", async () => {
- presenter.document = "zoo";
-
- await sut.startFind("giraffe");
-
- expect(await presenter.highlighted).to.be.false;
- expect(await consoleClient.text).to.equal("Pattern not found: giraffe");
- expect(await repository.getLastKeyword()).to.equal("giraffe");
- expect(await client.getGlobalLastKeyword()).to.equal("giraffe");
- });
-
- it("show errors when no last keywords", async () => {
- repository.keyword = null;
- client.keyword = null;
-
- await sut.startFind(undefined);
-
- expect(await consoleClient.text).to.equal("No previous search keywords");
- expect(await consoleClient.isError).to.be.true;
- });
- });
-
- describe("#findNext", () => {
- it("finds by last keyword", async () => {
- presenter.document = "monkey punch";
- repository.keyword = "monkey";
-
- await sut.findNext();
-
- expect(await presenter.highlighted).to.be.true;
- expect(await consoleClient.text).to.equal("Pattern found: monkey");
- });
-
- it("show errors when no last keywords", async () => {
- repository.keyword = null;
- client.keyword = null;
-
- await sut.findNext();
-
- expect(await consoleClient.text).to.equal("No previous search keywords");
- expect(await consoleClient.isError).to.be.true;
- });
- });
-
- describe("#findPrev", () => {});
-});
diff --git a/test/content/usecases/HintKeyProducer.test.ts b/test/content/usecases/HintKeyProducer.test.ts
index 9d320b4..a4ad4de 100644
--- a/test/content/usecases/HintKeyProducer.test.ts
+++ b/test/content/usecases/HintKeyProducer.test.ts
@@ -1,5 +1,4 @@
import { HintKeyRepositoryImpl } from "../../../src/content/repositories/HintKeyRepository";
-import { expect } from "chai";
describe("HintKeyProducerImpl class", () => {
describe("#produce", () => {
@@ -27,7 +26,7 @@ describe("HintKeyProducerImpl class", () => {
const sut = new HintKeyRepositoryImpl();
sut.reset(charset);
for (let i = 0; i < sequences.length; ++i) {
- expect(sut.produce()).to.equal(sequences[i]);
+ expect(sut.produce()).toEqual(sequences[i]);
}
});
});
@@ -37,16 +36,16 @@ describe("HintKeyProducerImpl class", () => {
const sut = new HintKeyRepositoryImpl();
sut.reset("ab");
- expect(sut.produce()).to.equal("a");
- expect(sut.produce()).to.equal("b");
+ expect(sut.produce()).toEqual("a");
+ expect(sut.produce()).toEqual("b");
sut.reset("xy");
- expect(sut.produce()).to.equal("x");
- expect(sut.produce()).to.equal("y");
+ expect(sut.produce()).toEqual("x");
+ expect(sut.produce()).toEqual("y");
});
it("throws an exception on empty charset", () => {
const sut = new HintKeyRepositoryImpl();
- expect(() => sut.reset("")).to.throw(TypeError);
+ expect(() => sut.reset("")).toThrow(TypeError);
});
});
});
diff --git a/test/content/usecases/KeymapUseCase.test.ts b/test/content/usecases/KeymapUseCase.test.ts
index 24ac6d8..7af3ab2 100644
--- a/test/content/usecases/KeymapUseCase.test.ts
+++ b/test/content/usecases/KeymapUseCase.test.ts
@@ -1,6 +1,5 @@
import "reflect-metadata";
import KeymapUseCase from "../../../src/content/usecases/KeymapUseCase";
-import { expect } from "chai";
import SettingRepository from "../../../src/content/repositories/SettingRepository";
import Settings from "../../../src/shared/settings/Settings";
import AddonEnabledRepository from "../../../src/content/repositories/AddonEnabledRepository";
@@ -41,7 +40,7 @@ class MockAddressRepository implements AddressRepository {
}
describe("KeymapUseCase", () => {
- context("with no-digis keymaps", () => {
+ describe("with no-digis keymaps", () => {
const settings = Settings.fromJSON({
keymaps: {
k: { type: "scroll.vertically", count: -1 },
@@ -52,7 +51,7 @@ describe("KeymapUseCase", () => {
let sut: KeymapUseCase;
- before(() => {
+ beforeEach(() => {
sut = new KeymapUseCase(
new KeymapRepositoryImpl(),
new MockSettingRepository(settings),
@@ -62,34 +61,34 @@ describe("KeymapUseCase", () => {
});
it("returns matched operation", () => {
- expect(sut.nextOps(Key.fromMapKey("k"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("k"))).toEqual({
repeat: 1,
op: { type: "scroll.vertically", count: -1 },
});
- expect(sut.nextOps(Key.fromMapKey("j"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("j"))).toEqual({
repeat: 1,
op: { type: "scroll.vertically", count: 1 },
});
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toEqual({
repeat: 1,
op: { type: "scroll.top" },
});
- expect(sut.nextOps(Key.fromMapKey("z"))).to.be.null;
+ expect(sut.nextOps(Key.fromMapKey("z"))).toBeNull;
});
it("repeats n-times by numeric prefix and multiple key operations", () => {
- expect(sut.nextOps(Key.fromMapKey("1"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("0"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("1"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("0"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toEqual({
repeat: 10,
op: { type: "scroll.top" },
});
});
});
- context("when keymaps containing numeric mappings", () => {
+ describe("when keymaps containing numeric mappings", () => {
const settings = Settings.fromJSON({
keymaps: {
20: { type: "scroll.top" },
@@ -99,7 +98,7 @@ describe("KeymapUseCase", () => {
let sut: KeymapUseCase;
- before(() => {
+ beforeEach(() => {
sut = new KeymapUseCase(
new KeymapRepositoryImpl(),
new MockSettingRepository(settings),
@@ -109,43 +108,43 @@ describe("KeymapUseCase", () => {
});
it("returns the matched operation ends with digit", () => {
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("5"))).to.be.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("5"))).toEqual({
repeat: 1,
op: { type: "scroll.bottom" },
});
});
it("returns an operation matched the operation with digit keymaps", () => {
- expect(sut.nextOps(Key.fromMapKey("2"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("0"))).to.be.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("2"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("0"))).toEqual({
repeat: 1,
op: { type: "scroll.top" },
});
});
it("returns operations repeated by numeric prefix", () => {
- expect(sut.nextOps(Key.fromMapKey("2"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("5"))).to.be.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("2"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("5"))).toEqual({
repeat: 2,
op: { type: "scroll.bottom" },
});
});
it("does not matches with digit operation with numeric prefix", () => {
- expect(sut.nextOps(Key.fromMapKey("3"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("2"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("0"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("5"))).to.be.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("3"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("2"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("0"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("5"))).toEqual({
repeat: 320,
op: { type: "scroll.bottom" },
});
});
});
- context("when the keys are mismatched with the operations", () => {
+ describe("when the keys are mismatched with the operations", () => {
const settings = Settings.fromJSON({
keymaps: {
gg: { type: "scroll.top" },
@@ -155,7 +154,7 @@ describe("KeymapUseCase", () => {
let sut: KeymapUseCase;
- before(() => {
+ beforeEach(() => {
sut = new KeymapUseCase(
new KeymapRepositoryImpl(),
new MockSettingRepository(settings),
@@ -165,31 +164,31 @@ describe("KeymapUseCase", () => {
});
it("clears input keys with no-matched operations", () => {
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("x"))).to.be.null; // clear
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("x"))).toBeNull; // clear
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toEqual({
repeat: 1,
op: { type: "scroll.top" },
});
});
it("clears input keys and the prefix with no-matched operations", () => {
- expect(sut.nextOps(Key.fromMapKey("1"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("0"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("x"))).to.be.null; // clear
- expect(sut.nextOps(Key.fromMapKey("1"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("0"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("1"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("0"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("x"))).toBeNull; // clear
+ expect(sut.nextOps(Key.fromMapKey("1"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("0"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toEqual({
repeat: 10,
op: { type: "scroll.top" },
});
});
});
- context("when the site matches to the blacklist", () => {
+ describe("when the site matches to the blacklist", () => {
const settings = Settings.fromJSON({
keymaps: {
k: { type: "scroll.vertically", count: -1 },
@@ -200,7 +199,7 @@ describe("KeymapUseCase", () => {
let sut: KeymapUseCase;
- before(() => {
+ beforeEach(() => {
sut = new KeymapUseCase(
new KeymapRepositoryImpl(),
new MockSettingRepository(settings),
@@ -210,19 +209,19 @@ describe("KeymapUseCase", () => {
});
it("returns only ADDON_ENABLE and ADDON_TOGGLE_ENABLED operation", () => {
- expect(sut.nextOps(Key.fromMapKey("k"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("a"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("k"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("a"))).toEqual({
repeat: 1,
op: { type: "addon.enable" },
});
- expect(sut.nextOps(Key.fromMapKey("b"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("b"))).toEqual({
repeat: 1,
op: { type: "addon.toggle.enabled" },
});
});
});
- context("when the site matches to the partial blacklist", () => {
+ describe("when the site matches to the partial blacklist", () => {
const settings = Settings.fromJSON({
keymaps: {
k: { type: "scroll.vertically", count: -1 },
@@ -244,17 +243,17 @@ describe("KeymapUseCase", () => {
new MockAddressRepository(new URL("https://example.com"))
);
- expect(sut.nextOps(Key.fromMapKey("k"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("k"))).toEqual({
repeat: 1,
op: { type: "scroll.vertically", count: -1 },
});
- expect(sut.nextOps(Key.fromMapKey("j"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("j"))).toEqual({
repeat: 1,
op: { type: "scroll.vertically", count: 1 },
});
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("G"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("G"))).toEqual({
repeat: 1,
op: { type: "scroll.bottom" },
});
@@ -266,12 +265,12 @@ describe("KeymapUseCase", () => {
new MockAddressRepository(new URL("https://example.org"))
);
- expect(sut.nextOps(Key.fromMapKey("g"))).to.be.null;
- expect(sut.nextOps(Key.fromMapKey("g"))).to.deep.equal({
+ expect(sut.nextOps(Key.fromMapKey("g"))).toBeNull;
+ expect(sut.nextOps(Key.fromMapKey("g"))).toEqual({
repeat: 1,
op: { type: "scroll.top" },
});
- expect(sut.nextOps(Key.fromMapKey("G"))).to.be.null;
+ expect(sut.nextOps(Key.fromMapKey("G"))).toBeNull;
});
});
});
diff --git a/test/content/usecases/MarkUseCase.test.ts b/test/content/usecases/MarkUseCase.test.ts
index df3f7bf..b788c3c 100644
--- a/test/content/usecases/MarkUseCase.test.ts
+++ b/test/content/usecases/MarkUseCase.test.ts
@@ -5,7 +5,6 @@ import MarkClient from "../../../src/content/client/MarkClient";
import MockConsoleClient from "../mock/MockConsoleClient";
import MockScrollPresenter from "../mock/MockScrollPresenter";
import Mark from "../../../src/content/domains/Mark";
-import { expect } from "chai";
class MockMarkRepository implements MarkRepository {
private current: { [key: string]: Mark };
@@ -70,8 +69,8 @@ describe("MarkUseCase", () => {
await sut.set("x");
- expect(repository.get("x")).to.deep.equals({ x: 10, y: 20 });
- expect(consoleClient.text).to.equal("Set local mark to 'x'");
+ expect(repository.get("x")).toEqual({ x: 10, y: 20 });
+ expect(consoleClient.text).toEqual("Set local mark to 'x'");
});
it("sets global mark", async () => {
@@ -79,8 +78,8 @@ describe("MarkUseCase", () => {
await sut.set("Z");
- expect(client.marks["Z"]).to.deep.equals({ x: 30, y: 40 });
- expect(consoleClient.text).to.equal("Set global mark to 'Z'");
+ expect(client.marks["Z"]).toEqual({ x: 30, y: 40 });
+ expect(consoleClient.text).toEqual("Set global mark to 'Z'");
});
});
@@ -90,7 +89,7 @@ describe("MarkUseCase", () => {
await sut.jump("x");
- expect(scrollPresenter.getScroll()).to.deep.equals({ x: 20, y: 40 });
+ expect(scrollPresenter.getScroll()).toEqual({ x: 20, y: 40 });
});
it("throws an error when no local marks", () => {
@@ -100,7 +99,7 @@ describe("MarkUseCase", () => {
throw new Error("error");
})
.catch((e) => {
- expect(e).to.be.instanceof(Error);
+ expect(e).toBeInstanceOf(Error);
});
});
@@ -109,7 +108,7 @@ describe("MarkUseCase", () => {
await sut.jump("Z");
- expect(client.last).to.equal("Z");
+ expect(client.last).toEqual("Z");
});
});
});
diff --git a/test/content/usecases/SettingUseCaase.test.ts b/test/content/usecases/SettingUseCaase.test.ts
index 1cc1e8a..8339bd9 100644
--- a/test/content/usecases/SettingUseCaase.test.ts
+++ b/test/content/usecases/SettingUseCaase.test.ts
@@ -4,7 +4,6 @@ import SettingUseCase from "../../../src/content/usecases/SettingUseCase";
import Settings, {
DefaultSetting,
} from "../../../src/shared/settings/Settings";
-import { expect } from "chai";
class MockSettingRepository implements SettingRepository {
private current: Settings;
@@ -64,10 +63,10 @@ describe("AddonEnabledUseCase", () => {
describe("#reload", () => {
it("loads settings and store to repository", async () => {
const settings = await sut.reload();
- expect(settings.properties.hintchars).to.equal("abcd1234");
+ expect(settings.properties.hintchars).toEqual("abcd1234");
const saved = repository.get();
- expect(saved.properties.hintchars).to.equal("abcd1234");
+ expect(saved.properties.hintchars).toEqual("abcd1234");
});
});
});