mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Updated tests
This commit is contained in:
@@ -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>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user