aboutsummaryrefslogtreecommitdiff
path: root/test/console/components/ErrorMessage.test.tsx
blob: 46ec0b03e4cbb09ec37cec494dfcc0bfa66cd0f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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!"]);
  });
});