mirror of
https://github.com/wassname/talk.git
synced 2026-07-20 12:40:47 +08:00
Adds test
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import React from "react";
|
||||
import TestRenderer from "react-test-renderer";
|
||||
|
||||
import { PropTypesOf } from "talk-ui/types";
|
||||
|
||||
import ValidationMessage from "./ValidationMessage";
|
||||
|
||||
it("renders correctly", () => {
|
||||
const props: PropTypesOf<typeof ValidationMessage> = {
|
||||
className: "custom",
|
||||
color: "error",
|
||||
children: "Hello World",
|
||||
};
|
||||
const renderer = TestRenderer.create(<ValidationMessage {...props} />);
|
||||
expect(renderer.toJSON()).toMatchSnapshot();
|
||||
});
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders correctly 1`] = `
|
||||
<div
|
||||
className="ValidationMessage-root ValidationMessage-colorError custom"
|
||||
>
|
||||
<span
|
||||
className="Icon-root ValidationMessage-icon Icon-xsm"
|
||||
>
|
||||
warning
|
||||
</span>
|
||||
Hello World
|
||||
</div>
|
||||
`;
|
||||
Reference in New Issue
Block a user