Updated tests

This commit is contained in:
Belén Curcio
2018-09-11 10:01:14 -03:00
parent 1ca2c5ec95
commit 91d421ad46
2 changed files with 29 additions and 1 deletions
@@ -4,6 +4,7 @@ import TestRenderer from "react-test-renderer";
import { PropTypesOf } from "talk-ui/types";
import Message from "./Message";
import MessageIcon from "./MessageIcon";
it("renders correctly", () => {
const props: PropTypesOf<typeof Message> = {
@@ -13,3 +14,16 @@ it("renders correctly", () => {
const renderer = TestRenderer.create(<Message {...props} />);
expect(renderer.toJSON()).toMatchSnapshot();
});
it("renders icon", () => {
const props: PropTypesOf<typeof Message> = {
className: "custom",
};
const renderer = TestRenderer.create(
<Message {...props}>
<MessageIcon>alert</MessageIcon>Alert Message
</Message>
);
expect(renderer.toJSON()).toMatchSnapshot();
});
@@ -2,8 +2,22 @@
exports[`renders correctly 1`] = `
<div
className="Message-root Message-colorInfo custom"
className="Message-root Message-colorGrey custom"
>
Hello World
</div>
`;
exports[`renders icon 1`] = `
<div
className="Message-root Message-colorGrey custom"
>
<span
aria-hidden="true"
className="Icon-root MessageIcon-root Icon-sm"
>
alert
</span>
Alert Message
</div>
`;