aboutsummaryrefslogtreecommitdiff
path: root/test/settings/components/form/KeymapsForm.test.tsx
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-10-10 01:42:37 +0000
committerGitHub <noreply@github.com>2021-10-10 01:42:37 +0000
commitdfcefe1b84cc96ead1c8d8f9aa65ff05ccd70378 (patch)
tree12f1a4ed6da8fd96c034d23bcf08b1535bca1113 /test/settings/components/form/KeymapsForm.test.tsx
parent24f4f06db6572d81cadfe191f36c433a79985871 (diff)
parent039095e18562c44edda2c5a83a3d82c2e220b370 (diff)
Merge pull request #1267 from ueokande/move-to-jest
Move to Jest
Diffstat (limited to 'test/settings/components/form/KeymapsForm.test.tsx')
-rw-r--r--test/settings/components/form/KeymapsForm.test.tsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/settings/components/form/KeymapsForm.test.tsx b/test/settings/components/form/KeymapsForm.test.tsx
index 1cec889..4701a96 100644
--- a/test/settings/components/form/KeymapsForm.test.tsx
+++ b/test/settings/components/form/KeymapsForm.test.tsx
@@ -1,10 +1,13 @@
+/**
+ * @jest-environment jsdom
+ */
+
import React from "react";
import ReactDOM from "react-dom";
import ReactTestRenderer from "react-test-renderer";
import ReactTestUtils from "react-dom/test-utils";
import KeymapsForm from "../../../../src/settings/components/form/KeymapsForm";
import { FormKeymaps } from "../../../../src/shared/SettingData";
-import { expect } from "chai";
describe("settings/form/KeymapsForm", () => {
describe("render", () => {
@@ -21,8 +24,8 @@ describe("settings/form/KeymapsForm", () => {
const inputj = root.findByProps({ id: 'scroll.vertically?{"count":1}' });
const inputk = root.findByProps({ id: 'scroll.vertically?{"count":-1}' });
- expect(inputj.props.value).to.equal("j");
- expect(inputk.props.value).to.equal("k");
+ expect(inputj.props.value).toEqual("j");
+ expect(inputk.props.value).toEqual("k");
});
it("renders blank value", () => {
@@ -31,8 +34,8 @@ describe("settings/form/KeymapsForm", () => {
const inputj = root.findByProps({ id: 'scroll.vertically?{"count":1}' });
const inputk = root.findByProps({ id: 'scroll.vertically?{"count":-1}' });
- expect(inputj.props.value).to.be.empty;
- expect(inputk.props.value).to.be.empty;
+ expect(inputj.props.value).toHaveLength(0);
+ expect(inputk.props.value).toHaveLength(0);
});
});
@@ -57,7 +60,7 @@ describe("settings/form/KeymapsForm", () => {
'scroll.vertically?{"count":-1}': "k",
})}
onChange={(value) => {
- expect(value.toJSON()['scroll.vertically?{"count":1}']).to.equal(
+ expect(value.toJSON()['scroll.vertically?{"count":1}']).toEqual(
"jjj"
);
done();