aboutsummaryrefslogtreecommitdiff
path: root/test/settings
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-08-11 21:40:23 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2020-08-11 21:40:23 +0900
commit0b98a22eba4f7bbac215abd800293ac2be67b24d (patch)
treeae78b7edc460a79708742bff55c4c6fa55699e47 /test/settings
parentf497109ecc801660dc23bbad8445b120cd75561e (diff)
Enable @typescript-eslint/no-extra-non-null-assertion
Diffstat (limited to 'test/settings')
-rw-r--r--test/settings/components/ui/input.test.tsx18
-rw-r--r--test/settings/reducers/setting.test.ts6
2 files changed, 12 insertions, 12 deletions
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);
});
});