diff options
Diffstat (limited to 'test/console/components/ErrorMessage.test.tsx')
-rw-r--r-- | test/console/components/ErrorMessage.test.tsx | 17 |
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!"]); + }); +}); |