aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/background/repositories/Mark.test.ts4
-rw-r--r--test/content/presenters/Hint.test.ts10
-rw-r--r--test/settings/components/ui/input.test.tsx18
-rw-r--r--test/settings/reducers/setting.test.ts6
4 files changed, 19 insertions, 19 deletions
diff --git a/test/background/repositories/Mark.test.ts b/test/background/repositories/Mark.test.ts
index 5cee5b6..3b054e5 100644
--- a/test/background/repositories/Mark.test.ts
+++ b/test/background/repositories/Mark.test.ts
@@ -13,13 +13,13 @@ describe("background/repositories/mark", () => {
await repository.setMark("A", mark);
- let got = (await repository.getMark("A"))!!;
+ let got = (await repository.getMark("A"))!;
expect(got.tabId).to.equal(1);
expect(got.url).to.equal("http://example.com");
expect(got.x).to.equal(10);
expect(got.y).to.equal(30);
- got = (await repository.getMark("B"))!!;
+ got = (await repository.getMark("B"))!;
expect(got).to.be.undefined;
});
});
diff --git a/test/content/presenters/Hint.test.ts b/test/content/presenters/Hint.test.ts
index f961f88..1a7c868 100644
--- a/test/content/presenters/Hint.test.ts
+++ b/test/content/presenters/Hint.test.ts
@@ -13,17 +13,17 @@ describe("Hint", () => {
describe("#constructor", () => {
it("creates a hint element with tag name", () => {
- const link = document.getElementById("test-link")!!;
+ const link = document.getElementById("test-link")!;
new Hint(link, "abc");
const elem = document.querySelector(".vimvixen-hint");
- expect(elem!!.textContent!!.trim()).to.be.equal("abc");
+ expect(elem!.textContent!.trim()).to.be.equal("abc");
});
});
describe("#show", () => {
it("shows an element", () => {
- const link = document.getElementById("test-link")!!;
+ const link = document.getElementById("test-link")!;
const hint = new Hint(link, "abc");
hint.hide();
hint.show();
@@ -46,10 +46,10 @@ describe("Hint", () => {
describe("#remove", () => {
it("removes an element", () => {
- const link = document.getElementById("test-link")!!;
+ const link = document.getElementById("test-link")!;
const hint = new Hint(link, "abc");
- const elem = document.querySelector(".vimvixen-hint")!!;
+ const elem = document.querySelector(".vimvixen-hint")!;
expect(elem.parentElement).to.not.be.null;
hint.remove();
expect(elem.parentElement).to.be.null;
diff --git a/test/settings/components/ui/input.test.tsx b/test/settings/components/ui/input.test.tsx
index 191bfed..d244d8f 100644
--- a/test/settings/components/ui/input.test.tsx
+++ b/test/settings/components/ui/input.test.tsx
@@ -25,8 +25,8 @@ describe("settings/ui/Input", () => {
);
});
- const label = document.querySelector("label")!!;
- const input = document.querySelector("input")!!;
+ const label = document.querySelector("label")!;
+ const input = document.querySelector("input")!;
expect(label.textContent).to.contain("myfield");
expect(input.type).to.contain("text");
expect(input.name).to.contain("myname");
@@ -50,7 +50,7 @@ describe("settings/ui/Input", () => {
);
});
- const input = document.querySelector("input")!!;
+ const input = document.querySelector("input")!;
input.value = "newvalue";
ReactTestUtils.Simulate.change(input);
});
@@ -65,8 +65,8 @@ describe("settings/ui/Input", () => {
);
});
- const label = document.querySelector("label")!!;
- const input = document.querySelector("input")!!;
+ const label = document.querySelector("label")!;
+ const input = document.querySelector("input")!;
expect(label.textContent).to.contain("myfield");
expect(input.type).to.contain("radio");
expect(input.name).to.contain("myname");
@@ -111,9 +111,9 @@ describe("settings/ui/Input", () => {
);
});
- const label = document.querySelector("label")!!;
- const textarea = document.querySelector("textarea")!!;
- const error = document.querySelector(".settings-ui-input-error")!!;
+ const label = document.querySelector("label")!;
+ const textarea = document.querySelector("textarea")!;
+ const error = document.querySelector(".settings-ui-input-error")!;
expect(label.textContent).to.contain("myfield");
expect(textarea.nodeName).to.contain("TEXTAREA");
expect(textarea.name).to.contain("myname");
@@ -138,7 +138,7 @@ describe("settings/ui/Input", () => {
);
});
- const input = document.querySelector("textarea")!!;
+ const input = document.querySelector("textarea")!;
input.value = "newvalue";
ReactTestUtils.Simulate.change(input);
});
diff --git a/test/settings/reducers/setting.test.ts b/test/settings/reducers/setting.test.ts
index 99c4c80..34e76e2 100644
--- a/test/settings/reducers/setting.test.ts
+++ b/test/settings/reducers/setting.test.ts
@@ -24,7 +24,7 @@ describe("settings setting reducer", () => {
};
const state = settingReducer(undefined, action);
expect(state.source).to.equal("json");
- expect(state.json!!.toJSONText()).to.equal('{ "key": "value" }');
+ expect(state.json!.toJSONText()).to.equal('{ "key": "value" }');
expect(state.form).to.deep.equal(action.form);
});
@@ -36,7 +36,7 @@ describe("settings setting reducer", () => {
};
const state = settingReducer(undefined, action);
expect(state.error).to.equal("bad value");
- expect(state.json!!.toJSONText()).to.equal("{}");
+ expect(state.json!.toJSONText()).to.equal("{}");
});
it("return next state for SETTING_SWITCH_TO_FORM", () => {
@@ -55,7 +55,7 @@ describe("settings setting reducer", () => {
json: JSONTextSettings.fromText("{}"),
};
const state = settingReducer(undefined, action);
- expect(state.json!!.toJSONText()).to.equal("{}");
+ expect(state.json!.toJSONText()).to.equal("{}");
expect(state.source).to.equal(SettingSource.JSON);
});
});