aboutsummaryrefslogtreecommitdiff
path: root/test/console
diff options
context:
space:
mode:
Diffstat (limited to 'test/console')
-rw-r--r--test/console/components/console/Message.test.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/console/components/console/Message.test.tsx b/test/console/components/console/Message.test.tsx
new file mode 100644
index 0000000..f8f950a
--- /dev/null
+++ b/test/console/components/console/Message.test.tsx
@@ -0,0 +1,27 @@
+import React from "react";
+import ReactTestRenderer from "react-test-renderer";
+import { expect } from "chai";
+import Message from "../../../../src/console/components/console/Message";
+
+describe("console/components/console/completion/Message", () => {
+ it("renders an information message", () => {
+ const root = ReactTestRenderer.create(<Message mode="info">Hello!</Message>)
+ .root;
+
+ const p = root.findByType("p");
+
+ expect(p.props["role"]).to.equal("status");
+ expect(p.children).to.deep.equal(["Hello!"]);
+ });
+
+ it("renders an error message", () => {
+ const root = ReactTestRenderer.create(
+ <Message mode="error">Hello!</Message>
+ ).root;
+
+ const p = root.findByType("p");
+
+ expect(p.props["role"]).to.equal("alert");
+ expect(p.children).to.deep.equal(["Hello!"]);
+ });
+});