aboutsummaryrefslogtreecommitdiff
path: root/test/settings/components/ui/Radio.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/ui/Radio.test.tsx
parent24f4f06db6572d81cadfe191f36c433a79985871 (diff)
parent039095e18562c44edda2c5a83a3d82c2e220b370 (diff)
Merge pull request #1267 from ueokande/move-to-jest
Move to Jest
Diffstat (limited to 'test/settings/components/ui/Radio.test.tsx')
-rw-r--r--test/settings/components/ui/Radio.test.tsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/settings/components/ui/Radio.test.tsx b/test/settings/components/ui/Radio.test.tsx
index f929ee3..e2bf214 100644
--- a/test/settings/components/ui/Radio.test.tsx
+++ b/test/settings/components/ui/Radio.test.tsx
@@ -1,8 +1,11 @@
+/**
+ * @jest-environment jsdom
+ */
+
import React from "react";
import ReactDOM from "react-dom";
import ReactTestUtils from "react-dom/test-utils";
import Radio from "../../../../src/settings/components/ui/Radio";
-import { expect } from "chai";
describe("settings/ui/Radio", () => {
let container: HTMLDivElement;
@@ -26,10 +29,10 @@ describe("settings/ui/Radio", () => {
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("myradio");
- expect(input.value).to.contain("myvalue");
+ expect(label.textContent).toEqual("myfield");
+ expect(input.type).toEqual("radio");
+ expect(input.name).toEqual("myradio");
+ expect(input.value).toEqual("myvalue");
});
it("invoke onChange", (done) => {
@@ -41,7 +44,7 @@ describe("settings/ui/Radio", () => {
label="myfield"
value="myvalue"
onChange={(e) => {
- expect((e.target as HTMLInputElement).checked).to.be.true;
+ expect((e.target as HTMLInputElement).checked).toBeTruthy;
done();
}}
/>,