mirror of
https://github.com/wassname/talk.git
synced 2026-08-17 11:27:52 +08:00
Merge branch 'next' into next-passport
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import React from "react";
|
||||
import { createRenderer } from "react-test-renderer/shallow";
|
||||
import Comment from "./Comment";
|
||||
|
||||
it("renders username and body", () => {
|
||||
const props = {
|
||||
author: {
|
||||
username: "Marvin",
|
||||
},
|
||||
body: "Woof",
|
||||
};
|
||||
const renderer = createRenderer();
|
||||
renderer.render(<Comment {...props} />);
|
||||
expect(renderer.getRenderOutput()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("renders with gutterBottom", () => {
|
||||
const props = {
|
||||
author: {
|
||||
username: "Marvin",
|
||||
},
|
||||
body: "Woof",
|
||||
gutterBottom: true,
|
||||
};
|
||||
const renderer = createRenderer();
|
||||
renderer.render(<Comment {...props} />);
|
||||
expect(renderer.getRenderOutput()).toMatchSnapshot();
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders username and body 1`] = `
|
||||
<div
|
||||
className="root"
|
||||
>
|
||||
<withPropsOnChange(Typography)
|
||||
className="author"
|
||||
gutterBottom={true}
|
||||
>
|
||||
Marvin
|
||||
</withPropsOnChange(Typography)>
|
||||
<withPropsOnChange(Typography)>
|
||||
Woof
|
||||
</withPropsOnChange(Typography)>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders with gutterBottom 1`] = `
|
||||
<div
|
||||
className="root gutterBottom"
|
||||
>
|
||||
<withPropsOnChange(Typography)
|
||||
className="author"
|
||||
gutterBottom={true}
|
||||
>
|
||||
Marvin
|
||||
</withPropsOnChange(Typography)>
|
||||
<withPropsOnChange(Typography)>
|
||||
Woof
|
||||
</withPropsOnChange(Typography)>
|
||||
</div>
|
||||
`;
|
||||
Reference in New Issue
Block a user