aboutsummaryrefslogtreecommitdiff
path: root/test/console/components/ErrorMessage.test.tsx
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-04-12 13:09:09 +0000
committerGitHub <noreply@github.com>2021-04-12 13:09:09 +0000
commitd80d0f87b82ba4bd74ed9b2bb7354421a28a11b3 (patch)
tree691185ad88418d0f44c236d0913cf5c425b29b23 /test/console/components/ErrorMessage.test.tsx
parentea73c900f66107fd4a5b2f3b05080bcf643c94ea (diff)
parent8a5bba1da639355a25da8c279a9f1cf0a7300a9f (diff)
Merge pull request #1098 from ueokande/replace-redux-with-react-hooks
Refactor state management with React Hooks on Console
Diffstat (limited to 'test/console/components/ErrorMessage.test.tsx')
-rw-r--r--test/console/components/ErrorMessage.test.tsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/console/components/ErrorMessage.test.tsx b/test/console/components/ErrorMessage.test.tsx
new file mode 100644
index 0000000..46ec0b0
--- /dev/null
+++ b/test/console/components/ErrorMessage.test.tsx
@@ -0,0 +1,17 @@
+import React from "react";
+import ReactTestRenderer from "react-test-renderer";
+import { expect } from "chai";
+import ErrorMessage from "../../../src/console/components/ErrorMessage";
+
+describe("console/components/console/completion/ErrorMessage", () => {
+ it("renders an error message", () => {
+ const root = ReactTestRenderer.create(
+ <ErrorMessage mode="error">Hello!</ErrorMessage>
+ ).root;
+
+ const p = root.findByType("p");
+
+ expect(p.props["role"]).to.equal("alert");
+ expect(p.children).to.deep.equal(["Hello!"]);
+ });
+});