Adds test

This commit is contained in:
Belen Curcio
2018-08-02 09:01:54 -03:00
parent 9e2b1aa9e3
commit 93044b3c6a
2 changed files with 30 additions and 0 deletions
@@ -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();
});
@@ -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>
`;