diff options
Diffstat (limited to 'test/settings/components/ui/TextArea.test.tsx')
-rw-r--r-- | test/settings/components/ui/TextArea.test.tsx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/test/settings/components/ui/TextArea.test.tsx b/test/settings/components/ui/TextArea.test.tsx index 232c7c0..76caec2 100644 --- a/test/settings/components/ui/TextArea.test.tsx +++ b/test/settings/components/ui/TextArea.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 TextArea from "../../../../src/settings/components/ui/TextArea"; -import { expect } from "chai"; describe("settings/ui/TextArea", () => { let container: HTMLDivElement; @@ -20,7 +23,6 @@ describe("settings/ui/TextArea", () => { ReactTestUtils.act(() => { ReactDOM.render( <TextArea - type="textarea" name="myname" label="myfield" value="myvalue" @@ -33,11 +35,11 @@ describe("settings/ui/TextArea", () => { const label = document.querySelector("label")!; const textarea = document.querySelector("textarea")!; const error = document.querySelector("[role=alert]")!; - expect(label.textContent).to.contain("myfield"); - expect(textarea.nodeName).to.contain("TEXTAREA"); - expect(textarea.name).to.contain("myname"); - expect(textarea.value).to.contain("myvalue"); - expect(error.textContent).to.contain("myerror"); + expect(label.textContent).toEqual("myfield"); + expect(textarea.nodeName).toEqual("TEXTAREA"); + expect(textarea.name).toEqual("myname"); + expect(textarea.value).toEqual("myvalue"); + expect(error.textContent).toEqual("myerror"); }); it("invoke onChange", (done) => { @@ -48,7 +50,7 @@ describe("settings/ui/TextArea", () => { label="myfield" value="myvalue" onChange={(e) => { - expect((e.target as HTMLInputElement).value).to.equal("newvalue"); + expect((e.target as HTMLTextAreaElement).value).toEqual("newvalue"); done(); }} />, |