aboutsummaryrefslogtreecommitdiff
path: root/test/console/components/ErrorMessage.test.tsx
blob: 45b30521fa53f088ff2e4d9abf1ae94d7a3ca020 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import React from "react";
import ReactTestRenderer from "react-test-renderer";
import ErrorMessage from "../../../src/console/components/ErrorMessage";

describe("console/components/console/completion/ErrorMessage", () => {
  it("renders an error message", () => {
    const root = ReactTestRenderer.create(
      <ErrorMessage>Hello!</ErrorMessage>
    ).root;

    const p = root.findByType("p");

    expect(p.props["role"]).toEqual("alert");
    expect(p.children).toEqual(["Hello!"]);
  });
});