aboutsummaryrefslogtreecommitdiff
path: root/test/background/operators
diff options
context:
space:
mode:
Diffstat (limited to 'test/background/operators')
-rw-r--r--test/background/operators/impls/CloseTabOperator.test.ts7
-rw-r--r--test/background/operators/impls/CloseTabRightOperator.test.ts3
-rw-r--r--test/background/operators/impls/CommandOperatorFactoryChain.test.ts15
-rw-r--r--test/background/operators/impls/DuplicateTabOperator.test.ts3
-rw-r--r--test/background/operators/impls/FindOperatorFactoryChain.ts5
-rw-r--r--test/background/operators/impls/InternalOperatorFactoryChain.test.ts7
-rw-r--r--test/background/operators/impls/NavigateOperatorFactoryChain.test.ts19
-rw-r--r--test/background/operators/impls/NavigateParentOperator.test.ts9
-rw-r--r--test/background/operators/impls/NavigateRootOperator.test.ts3
-rw-r--r--test/background/operators/impls/OpenHomeOperator.test.ts10
-rw-r--r--test/background/operators/impls/OpenSourceOperator.test.ts3
-rw-r--r--test/background/operators/impls/PinTabOperator.test.ts3
-rw-r--r--test/background/operators/impls/RepeatOperatorFactoryChain.test.ts5
-rw-r--r--test/background/operators/impls/SelectFirstTabOperator.test.ts3
-rw-r--r--test/background/operators/impls/SelectLastTabOperator.test.ts3
-rw-r--r--test/background/operators/impls/SelectPreviousSelectedTabOperator.test.ts3
-rw-r--r--test/background/operators/impls/SelectTabNextOperator.test.ts5
-rw-r--r--test/background/operators/impls/SelectTabPrevOperator.test.ts5
-rw-r--r--test/background/operators/impls/TabOperatorFactoryChain.test.ts35
-rw-r--r--test/background/operators/impls/TogglePinnedTabOperator.test.ts5
-rw-r--r--test/background/operators/impls/UnpinTabOperator.test.ts3
-rw-r--r--test/background/operators/impls/ZoomOperatorFactoryChain.test.ts9
22 files changed, 69 insertions, 94 deletions
diff --git a/test/background/operators/impls/CloseTabOperator.test.ts b/test/background/operators/impls/CloseTabOperator.test.ts
index ba9cbfe..f72e118 100644
--- a/test/background/operators/impls/CloseTabOperator.test.ts
+++ b/test/background/operators/impls/CloseTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import CloseTabOperator from "../../../../src/background/operators/impls/CloseTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -14,7 +13,7 @@ describe("CloseTabOperator", () => {
await sut.run();
const tabs = await tabPresenter.getAll();
- expect(tabs.map((t) => t.url)).to.deep.equal([
+ expect(tabs.map((t) => t.url)).toEqual([
"https://example.com/1",
"https://example.com/3",
]);
@@ -39,7 +38,7 @@ describe("CloseTabOperator", () => {
await sut.run();
const tabs = await tabPresenter.getAll();
- expect(tabs.map((t) => t.url)).to.deep.equal([
+ expect(tabs.map((t) => t.url)).toEqual([
"https://example.com/1",
"https://example.com/3",
]);
@@ -55,7 +54,7 @@ describe("CloseTabOperator", () => {
await sut.run();
const tab = await tabPresenter.getCurrent();
- expect(tab.url).to.equal("https://example.com/1");
+ expect(tab.url).toEqual("https://example.com/1");
});
});
});
diff --git a/test/background/operators/impls/CloseTabRightOperator.test.ts b/test/background/operators/impls/CloseTabRightOperator.test.ts
index c2a106c..8e2200e 100644
--- a/test/background/operators/impls/CloseTabRightOperator.test.ts
+++ b/test/background/operators/impls/CloseTabRightOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import MockTabPresenter from "../../mock/MockTabPresenter";
import CloseTabRightOperator from "../../../../src/background/operators/impls/CloseTabRightOperator";
@@ -15,7 +14,7 @@ describe("CloseTabRightOperator", () => {
await sut.run();
const tabs = await tabPresenter.getAll();
- expect(tabs.map((t) => t.url)).to.deep.equal([
+ expect(tabs.map((t) => t.url)).toEqual([
"https://example.com/1",
"https://example.com/2",
]);
diff --git a/test/background/operators/impls/CommandOperatorFactoryChain.test.ts b/test/background/operators/impls/CommandOperatorFactoryChain.test.ts
index e481c5a..ce8676a 100644
--- a/test/background/operators/impls/CommandOperatorFactoryChain.test.ts
+++ b/test/background/operators/impls/CommandOperatorFactoryChain.test.ts
@@ -1,5 +1,4 @@
import "reflect-metadata";
-import { expect } from "chai";
import CommandOperatorFactoryChain from "../../../../src/background/operators/impls/CommandOperatorFactoryChain";
import MockTabPresenter from "../../mock/MockTabPresenter";
import MockConsoleClient from "../../mock/MockConsoleClient";
@@ -18,25 +17,25 @@ describe("CommandOperatorFactoryChain", () => {
const consoleClient = new MockConsoleClient();
const sut = new CommandOperatorFactoryChain(tabPresenter, consoleClient);
- expect(sut.create({ type: operations.COMMAND_SHOW })).to.be.instanceOf(
+ expect(sut.create({ type: operations.COMMAND_SHOW })).toBeInstanceOf(
ShowCommandOperator
);
expect(
sut.create({ type: operations.COMMAND_SHOW_TABOPEN, alter: true })
- ).to.be.instanceOf(ShowTabOpenCommandOperator);
+ ).toBeInstanceOf(ShowTabOpenCommandOperator);
expect(
sut.create({ type: operations.COMMAND_SHOW_WINOPEN, alter: true })
- ).to.be.instanceOf(ShowWinOpenCommandOperator);
+ ).toBeInstanceOf(ShowWinOpenCommandOperator);
expect(
sut.create({ type: operations.COMMAND_SHOW_BUFFER })
- ).to.be.instanceOf(ShowBufferCommandOperator);
+ ).toBeInstanceOf(ShowBufferCommandOperator);
expect(
sut.create({ type: operations.COMMAND_SHOW_ADDBOOKMARK, alter: true })
- ).to.be.instanceOf(ShowAddBookmarkOperator);
- expect(sut.create({ type: operations.FIND_START })).to.be.instanceOf(
+ ).toBeInstanceOf(ShowAddBookmarkOperator);
+ expect(sut.create({ type: operations.FIND_START })).toBeInstanceOf(
StartFindOperator
);
- expect(sut.create({ type: operations.CANCEL })).to.be.null;
+ expect(sut.create({ type: operations.CANCEL })).toBeNull;
});
});
});
diff --git a/test/background/operators/impls/DuplicateTabOperator.test.ts b/test/background/operators/impls/DuplicateTabOperator.test.ts
index ce2c19d..cbc9e81 100644
--- a/test/background/operators/impls/DuplicateTabOperator.test.ts
+++ b/test/background/operators/impls/DuplicateTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import DuplicateTabOperator from "../../../../src/background/operators/impls/DuplicateTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -14,7 +13,7 @@ describe("DuplicateTabOperator", () => {
await sut.run();
const tabs = await tabPresenter.getAll();
- expect(tabs.map((t) => t.url)).to.deep.equal([
+ expect(tabs.map((t) => t.url)).toEqual([
"https://example.com/1",
"https://example.com/2",
"https://example.com/3",
diff --git a/test/background/operators/impls/FindOperatorFactoryChain.ts b/test/background/operators/impls/FindOperatorFactoryChain.ts
index 0fd234f..6b190ed 100644
--- a/test/background/operators/impls/FindOperatorFactoryChain.ts
+++ b/test/background/operators/impls/FindOperatorFactoryChain.ts
@@ -1,5 +1,4 @@
import "reflect-metadata";
-import { expect } from "chai";
import TabOperatorFactoryChain from "../../../../src/background/operators/impls/TabOperatorFactoryChain";
import MockTabPresenter from "../../mock/MockTabPresenter";
import * as operations from "../../../../src/shared/operations";
@@ -12,10 +11,10 @@ describe("FindOperatorFactoryChain", () => {
const tabPresenter = new MockTabPresenter();
const sut = new TabOperatorFactoryChain(tabPresenter);
- expect(sut.create({ type: operations.FIND_NEXT })).to.be.instanceOf(
+ expect(sut.create({ type: operations.FIND_NEXT })).toBeInstanceOf(
FindNextOperator
);
- expect(sut.create({ type: operations.FIND_PREV })).to.be.instanceOf(
+ expect(sut.create({ type: operations.FIND_PREV })).toBeInstanceOf(
FindPrevOperator
);
});
diff --git a/test/background/operators/impls/InternalOperatorFactoryChain.test.ts b/test/background/operators/impls/InternalOperatorFactoryChain.test.ts
index 09029db..c13ebaf 100644
--- a/test/background/operators/impls/InternalOperatorFactoryChain.test.ts
+++ b/test/background/operators/impls/InternalOperatorFactoryChain.test.ts
@@ -1,5 +1,4 @@
import "reflect-metadata";
-import { expect } from "chai";
import InternalOperatorFactoryChain from "../../../../src/background/operators/impls/InternalOperatorFactoryChain";
import MockWindowPresenter from "../../mock/MockWindowPresenter";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -20,7 +19,7 @@ describe("InternalOperatorFactoryChain", () => {
consoleClient
);
- expect(sut.create({ type: operations.CANCEL })).to.be.instanceOf(
+ expect(sut.create({ type: operations.CANCEL })).toBeInstanceOf(
CancelOperator
);
expect(
@@ -30,8 +29,8 @@ describe("InternalOperatorFactoryChain", () => {
newTab: false,
newWindow: false,
})
- ).to.be.instanceOf(InternalOpenURLOperator);
- expect(sut.create({ type: operations.COMMAND_SHOW })).to.be.null;
+ ).toBeInstanceOf(InternalOpenURLOperator);
+ expect(sut.create({ type: operations.COMMAND_SHOW })).toBeNull;
});
});
});
diff --git a/test/background/operators/impls/NavigateOperatorFactoryChain.test.ts b/test/background/operators/impls/NavigateOperatorFactoryChain.test.ts
index dfb5654..ae556f0 100644
--- a/test/background/operators/impls/NavigateOperatorFactoryChain.test.ts
+++ b/test/background/operators/impls/NavigateOperatorFactoryChain.test.ts
@@ -1,5 +1,4 @@
import "reflect-metadata";
-import { expect } from "chai";
import NavigateOperatorFactoryChain from "../../../../src/background/operators/impls/NavigateOperatorFactoryChain";
import MockTabPresenter from "../../mock/MockTabPresenter";
import MockNavigateClient from "../../mock/MockNavigateClient";
@@ -28,29 +27,29 @@ describe("NavigateOperatorFactoryChain", () => {
expect(
sut.create({ type: operations.NAVIGATE_HISTORY_PREV })
- ).to.be.instanceOf(NavigateHistoryPrevOperator);
+ ).toBeInstanceOf(NavigateHistoryPrevOperator);
expect(
sut.create({ type: operations.NAVIGATE_HISTORY_NEXT })
- ).to.be.instanceOf(NavigateHistoryNextOperator);
+ ).toBeInstanceOf(NavigateHistoryNextOperator);
expect(
sut.create({ type: operations.NAVIGATE_LINK_PREV })
- ).to.be.instanceOf(NavigateLinkPrevOperator);
+ ).toBeInstanceOf(NavigateLinkPrevOperator);
expect(
sut.create({ type: operations.NAVIGATE_LINK_NEXT })
- ).to.be.instanceOf(NavigateLinkNextOperator);
- expect(sut.create({ type: operations.NAVIGATE_PARENT })).to.be.instanceOf(
+ ).toBeInstanceOf(NavigateLinkNextOperator);
+ expect(sut.create({ type: operations.NAVIGATE_PARENT })).toBeInstanceOf(
NavigateParentOperator
);
- expect(sut.create({ type: operations.NAVIGATE_ROOT })).to.be.instanceOf(
+ expect(sut.create({ type: operations.NAVIGATE_ROOT })).toBeInstanceOf(
NavigateRootOperator
);
- expect(sut.create({ type: operations.PAGE_SOURCE })).to.be.instanceOf(
+ expect(sut.create({ type: operations.PAGE_SOURCE })).toBeInstanceOf(
OpenSourceOperator
);
expect(
sut.create({ type: operations.PAGE_HOME, newTab: false })
- ).to.be.instanceOf(OpenHomeOperator);
- expect(sut.create({ type: operations.CANCEL })).to.be.null;
+ ).toBeInstanceOf(OpenHomeOperator);
+ expect(sut.create({ type: operations.CANCEL })).toBeNull;
});
});
});
diff --git a/test/background/operators/impls/NavigateParentOperator.test.ts b/test/background/operators/impls/NavigateParentOperator.test.ts
index cc57f17..48c14dd 100644
--- a/test/background/operators/impls/NavigateParentOperator.test.ts
+++ b/test/background/operators/impls/NavigateParentOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import MockTabPresenter from "../../mock/MockTabPresenter";
import NavigateParentOperator from "../../../../src/background/operators/impls/NavigateParentOperator";
@@ -14,7 +13,7 @@ describe("NavigateParentOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.be.equal("https://example.com/fruits/yellow/");
+ expect(url).toEqual("https://example.com/fruits/yellow/");
});
it("opens a parent directory of the directoryin the URL", async () => {
@@ -25,7 +24,7 @@ describe("NavigateParentOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.be.equal("https://example.com/fruits/");
+ expect(url).toEqual("https://example.com/fruits/");
});
it("removes a hash in the URL", async () => {
@@ -36,7 +35,7 @@ describe("NavigateParentOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.be.equal("https://example.com/fruits/yellow/");
+ expect(url).toEqual("https://example.com/fruits/yellow/");
});
it("removes query parameters in the URL", async () => {
@@ -47,7 +46,7 @@ describe("NavigateParentOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.be.equal("https://example.com/search");
+ expect(url).toEqual("https://example.com/search");
});
});
});
diff --git a/test/background/operators/impls/NavigateRootOperator.test.ts b/test/background/operators/impls/NavigateRootOperator.test.ts
index bbe574c..379ce44 100644
--- a/test/background/operators/impls/NavigateRootOperator.test.ts
+++ b/test/background/operators/impls/NavigateRootOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import NavigateRootOperator from "../../../../src/background/operators/impls/NavigateRootOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -12,7 +11,7 @@ describe("NavigateRootOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.be.equal("https://example.com");
+ expect(url).toEqual("https://example.com");
});
});
});
diff --git a/test/background/operators/impls/OpenHomeOperator.test.ts b/test/background/operators/impls/OpenHomeOperator.test.ts
index 3c9288f..580aa49 100644
--- a/test/background/operators/impls/OpenHomeOperator.test.ts
+++ b/test/background/operators/impls/OpenHomeOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import OpenHomeOperator from "../../../../src/background/operators/impls/OpenHomeOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
import MockBrowserSettingRepository from "../../mock/MockBrowserSettingRepository";
@@ -20,7 +19,7 @@ describe("OpenHomeOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.be.equal("https://example.net/");
+ expect(url).toEqual("https://example.net/");
});
it("opens a home page of the browser into a new tab", async () => {
@@ -38,10 +37,7 @@ describe("OpenHomeOperator", () => {
await sut.run();
const urls = (await tabPresenter.getAll()).map((t) => t.url);
- expect(urls).to.be.deep.equal([
- "https://example.com/",
- "https://example.net/",
- ]);
+ expect(urls).toEqual(["https://example.com/", "https://example.net/"]);
});
it("opens home pages of the browser", async () => {
@@ -60,7 +56,7 @@ describe("OpenHomeOperator", () => {
await sut.run();
const urls = (await tabPresenter.getAll()).map((t) => t.url);
- expect(urls).to.be.deep.equal([
+ expect(urls).toEqual([
"https://example.com/",
"https://example.net/",
"https://example.org/",
diff --git a/test/background/operators/impls/OpenSourceOperator.test.ts b/test/background/operators/impls/OpenSourceOperator.test.ts
index 541032b..4d9423c 100644
--- a/test/background/operators/impls/OpenSourceOperator.test.ts
+++ b/test/background/operators/impls/OpenSourceOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import OpenSourceOperator from "../../../../src/background/operators/impls/OpenSourceOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -12,7 +11,7 @@ describe("OpenSourceOperator", () => {
await sut.run();
const urls = (await tabPresenter.getAll()).map((t) => t.url);
- expect(urls).to.be.deep.equal([
+ expect(urls).toEqual([
"https://example.com/",
"view-source:https://example.com/",
]);
diff --git a/test/background/operators/impls/PinTabOperator.test.ts b/test/background/operators/impls/PinTabOperator.test.ts
index 0c940b6..69082f2 100644
--- a/test/background/operators/impls/PinTabOperator.test.ts
+++ b/test/background/operators/impls/PinTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import PinTabOperator from "../../../../src/background/operators/impls/PinTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -19,7 +18,7 @@ describe("PinTabOperator", () => {
await sut.run();
const pins = (await tabPresenter.getAll()).map((t) => t.pinned);
- expect(pins).to.deep.equal([true, false]);
+ expect(pins).toEqual([true, false]);
});
});
});
diff --git a/test/background/operators/impls/RepeatOperatorFactoryChain.test.ts b/test/background/operators/impls/RepeatOperatorFactoryChain.test.ts
index e12d788..ec5e000 100644
--- a/test/background/operators/impls/RepeatOperatorFactoryChain.test.ts
+++ b/test/background/operators/impls/RepeatOperatorFactoryChain.test.ts
@@ -1,5 +1,4 @@
import "reflect-metadata";
-import { expect } from "chai";
import RepeatOperatorFactoryChain from "../../../../src/background/operators/impls/RepeatOperatorFactoryChain";
import RepeatLastOperator from "../../../../src/background/operators/impls/RepeatLastOperator";
import OperatorFactory from "../../../../src/background/operators/OperatorFactory";
@@ -23,10 +22,10 @@ describe("RepeatOperatorFactoryChain", () => {
operatorFactory
);
- expect(sut.create({ type: operations.REPEAT_LAST })).to.be.instanceOf(
+ expect(sut.create({ type: operations.REPEAT_LAST })).toBeInstanceOf(
RepeatLastOperator
);
- expect(sut.create({ type: operations.CANCEL })).to.be.null;
+ expect(sut.create({ type: operations.CANCEL })).toBeNull;
});
});
});
diff --git a/test/background/operators/impls/SelectFirstTabOperator.test.ts b/test/background/operators/impls/SelectFirstTabOperator.test.ts
index a3f1d7e..ae8a42e 100644
--- a/test/background/operators/impls/SelectFirstTabOperator.test.ts
+++ b/test/background/operators/impls/SelectFirstTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import SelectFirstTabOperator from "../../../../src/background/operators/impls/SelectFirstTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -14,7 +13,7 @@ describe("SelectFirstTabOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.equal("https://example.com/1");
+ expect(url).toEqual("https://example.com/1");
});
});
});
diff --git a/test/background/operators/impls/SelectLastTabOperator.test.ts b/test/background/operators/impls/SelectLastTabOperator.test.ts
index b8cf5c4..63668b1 100644
--- a/test/background/operators/impls/SelectLastTabOperator.test.ts
+++ b/test/background/operators/impls/SelectLastTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import SelectLastTabOperator from "../../../../src/background/operators/impls/SelectLastTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -14,7 +13,7 @@ describe("SelectLastTabOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.equal("https://example.com/3");
+ expect(url).toEqual("https://example.com/3");
});
});
});
diff --git a/test/background/operators/impls/SelectPreviousSelectedTabOperator.test.ts b/test/background/operators/impls/SelectPreviousSelectedTabOperator.test.ts
index 5e6cc73..5d6827d 100644
--- a/test/background/operators/impls/SelectPreviousSelectedTabOperator.test.ts
+++ b/test/background/operators/impls/SelectPreviousSelectedTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import sinon from "sinon";
import MockTabPresenter from "../../mock/MockTabPresenter";
import SelectPreviousSelectedTabOperator from "../../../../src/background/operators/impls/SelectPreviousSelectedTabOperator";
@@ -16,7 +15,7 @@ describe("SelectPreviousSelectedTabOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.equal("https://example.com/1");
+ expect(url).toEqual("https://example.com/1");
});
it("do nothing if no last-selected tabs", async () => {
diff --git a/test/background/operators/impls/SelectTabNextOperator.test.ts b/test/background/operators/impls/SelectTabNextOperator.test.ts
index 5952d92..cc845e5 100644
--- a/test/background/operators/impls/SelectTabNextOperator.test.ts
+++ b/test/background/operators/impls/SelectTabNextOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import MockTabPresenter from "../../mock/MockTabPresenter";
import SelectTabNextOperator from "../../../../src/background/operators/impls/SelectTabNextOperator";
@@ -14,7 +13,7 @@ describe("SelectTabNextOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.equal("https://example.com/3");
+ expect(url).toEqual("https://example.com/3");
});
});
@@ -29,7 +28,7 @@ describe("SelectTabNextOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.equal("https://example.com/1");
+ expect(url).toEqual("https://example.com/1");
});
});
});
diff --git a/test/background/operators/impls/SelectTabPrevOperator.test.ts b/test/background/operators/impls/SelectTabPrevOperator.test.ts
index c9092fa..41df299 100644
--- a/test/background/operators/impls/SelectTabPrevOperator.test.ts
+++ b/test/background/operators/impls/SelectTabPrevOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import MockTabPresenter from "../../mock/MockTabPresenter";
import SelectTabPrevOperator from "../../../../src/background/operators/impls/SelectTabPrevOperator";
@@ -14,7 +13,7 @@ describe("SelectTabPrevOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.equal("https://example.com/1");
+ expect(url).toEqual("https://example.com/1");
});
});
@@ -29,7 +28,7 @@ describe("SelectTabPrevOperator", () => {
await sut.run();
const url = (await tabPresenter.getCurrent()).url;
- expect(url).to.equal("https://example.com/3");
+ expect(url).toEqual("https://example.com/3");
});
});
});
diff --git a/test/background/operators/impls/TabOperatorFactoryChain.test.ts b/test/background/operators/impls/TabOperatorFactoryChain.test.ts
index a777973..57e6321 100644
--- a/test/background/operators/impls/TabOperatorFactoryChain.test.ts
+++ b/test/background/operators/impls/TabOperatorFactoryChain.test.ts
@@ -1,5 +1,4 @@
import "reflect-metadata";
-import { expect } from "chai";
import TabOperatorFactoryChain from "../../../../src/background/operators/impls/TabOperatorFactoryChain";
import MockTabPresenter from "../../mock/MockTabPresenter";
import DuplicateTabOperator from "../../../../src/background/operators/impls/DuplicateTabOperator";
@@ -23,49 +22,49 @@ describe("TabOperatorFactoryChain", () => {
const tabPresenter = new MockTabPresenter();
const sut = new TabOperatorFactoryChain(tabPresenter);
- expect(sut.create({ type: operations.TAB_CLOSE })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_CLOSE })).toBeInstanceOf(
CloseTabOperator
);
- expect(sut.create({ type: operations.TAB_CLOSE_RIGHT })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_CLOSE_RIGHT })).toBeInstanceOf(
CloseTabRightOperator
);
- expect(sut.create({ type: operations.TAB_CLOSE_FORCE })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_CLOSE_FORCE })).toBeInstanceOf(
CloseTabOperator
);
- expect(sut.create({ type: operations.TAB_REOPEN })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_REOPEN })).toBeInstanceOf(
ReopenTabOperator
);
- expect(sut.create({ type: operations.TAB_PREV })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_PREV })).toBeInstanceOf(
SelectTabPrevOperator
);
- expect(sut.create({ type: operations.TAB_NEXT })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_NEXT })).toBeInstanceOf(
SelectTabNextOperator
);
- expect(sut.create({ type: operations.TAB_FIRST })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_FIRST })).toBeInstanceOf(
SelectFirstTabOperator
);
- expect(sut.create({ type: operations.TAB_LAST })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_LAST })).toBeInstanceOf(
SelectLastTabOperator
);
- expect(sut.create({ type: operations.TAB_PREV_SEL })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_PREV_SEL })).toBeInstanceOf(
SelectPreviousSelectedTabOperator
);
expect(
sut.create({ type: operations.TAB_RELOAD, cache: false })
- ).to.be.instanceOf(ReloadTabOperator);
- expect(sut.create({ type: operations.TAB_PIN })).to.be.instanceOf(
+ ).toBeInstanceOf(ReloadTabOperator);
+ expect(sut.create({ type: operations.TAB_PIN })).toBeInstanceOf(
PinTabOperator
);
- expect(sut.create({ type: operations.TAB_UNPIN })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_UNPIN })).toBeInstanceOf(
UnpinTabOperator
);
- expect(
- sut.create({ type: operations.TAB_TOGGLE_PINNED })
- ).to.be.instanceOf(TogglePinnedTabOperator);
- expect(sut.create({ type: operations.TAB_DUPLICATE })).to.be.instanceOf(
+ expect(sut.create({ type: operations.TAB_TOGGLE_PINNED })).toBeInstanceOf(
+ TogglePinnedTabOperator
+ );
+ expect(sut.create({ type: operations.TAB_DUPLICATE })).toBeInstanceOf(
DuplicateTabOperator
);
- expect(sut.create({ type: operations.CANCEL })).to.be.null;
+ expect(sut.create({ type: operations.CANCEL })).toBeNull;
});
});
});
diff --git a/test/background/operators/impls/TogglePinnedTabOperator.test.ts b/test/background/operators/impls/TogglePinnedTabOperator.test.ts
index f155f83..fbd6c39 100644
--- a/test/background/operators/impls/TogglePinnedTabOperator.test.ts
+++ b/test/background/operators/impls/TogglePinnedTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import TogglePinnedTabOperator from "../../../../src/background/operators/impls/TogglePinnedTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -17,13 +16,13 @@ describe("TogglePinnedTabOperator", () => {
const sut = new TogglePinnedTabOperator(tabPresenter);
await sut.run();
- expect((await tabPresenter.getAll()).map((t) => t.pinned)).to.deep.equal([
+ expect((await tabPresenter.getAll()).map((t) => t.pinned)).toEqual([
true,
false,
]);
await sut.run();
- expect((await tabPresenter.getAll()).map((t) => t.pinned)).to.deep.equal([
+ expect((await tabPresenter.getAll()).map((t) => t.pinned)).toEqual([
false,
false,
]);
diff --git a/test/background/operators/impls/UnpinTabOperator.test.ts b/test/background/operators/impls/UnpinTabOperator.test.ts
index 745f48c..c30c94f 100644
--- a/test/background/operators/impls/UnpinTabOperator.test.ts
+++ b/test/background/operators/impls/UnpinTabOperator.test.ts
@@ -1,4 +1,3 @@
-import { expect } from "chai";
import UnpinTabOperator from "../../../../src/background/operators/impls/UnpinTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -19,7 +18,7 @@ describe("UnpinTabOperator", () => {
await sut.run();
const pins = (await tabPresenter.getAll()).map((t) => t.pinned);
- expect(pins).to.deep.equal([false, true]);
+ expect(pins).toEqual([false, true]);
});
});
});
diff --git a/test/background/operators/impls/ZoomOperatorFactoryChain.test.ts b/test/background/operators/impls/ZoomOperatorFactoryChain.test.ts
index 10c1cee..ab40a86 100644
--- a/test/background/operators/impls/ZoomOperatorFactoryChain.test.ts
+++ b/test/background/operators/impls/ZoomOperatorFactoryChain.test.ts
@@ -1,5 +1,4 @@
import "reflect-metadata";
-import { expect } from "chai";
import ZoomOperatorFactoryChain from "../../../../src/background/operators/impls/ZoomOperatorFactoryChain";
import MockZoomPresenter from "../../mock/MockZoomPresenter";
import ZoomInOperator from "../../../../src/background/operators/impls/ZoomInOperator";
@@ -13,16 +12,16 @@ describe("ZoomOperatorFactoryChain", () => {
const zoomPresenter = new MockZoomPresenter();
const sut = new ZoomOperatorFactoryChain(zoomPresenter);
- expect(sut.create({ type: operations.ZOOM_IN })).to.be.instanceOf(
+ expect(sut.create({ type: operations.ZOOM_IN })).toBeInstanceOf(
ZoomInOperator
);
- expect(sut.create({ type: operations.ZOOM_OUT })).to.be.instanceOf(
+ expect(sut.create({ type: operations.ZOOM_OUT })).toBeInstanceOf(
ZoomOutOperator
);
- expect(sut.create({ type: operations.ZOOM_NEUTRAL })).to.be.instanceOf(
+ expect(sut.create({ type: operations.ZOOM_NEUTRAL })).toBeInstanceOf(
ResetZoomOperator
);
- expect(sut.create({ type: operations.CANCEL })).to.be.null;
+ expect(sut.create({ type: operations.CANCEL })).toBeNull;
});
});
});