mirror of
https://github.com/wassname/talk.git
synced 2026-08-16 11:29:31 +08:00
Mark comments as always returning a value
This commit is contained in:
@@ -18,19 +18,6 @@ it("renders correctly", () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("renders when comments is null", () => {
|
||||
const props = {
|
||||
assetID: "asset-id",
|
||||
isClosed: false,
|
||||
comments: null,
|
||||
onLoadMore: noop,
|
||||
disableLoadMore: false,
|
||||
hasMore: false,
|
||||
};
|
||||
const wrapper = shallow(<Stream {...props} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("when there is more", () => {
|
||||
const props = {
|
||||
assetID: "asset-id",
|
||||
|
||||
@@ -12,17 +12,13 @@ import Logo from "./Logo";
|
||||
export interface StreamProps {
|
||||
assetID: string;
|
||||
isClosed: boolean;
|
||||
comments: ReadonlyArray<{ id: string }> | null;
|
||||
comments: ReadonlyArray<{ id: string }>;
|
||||
onLoadMore: () => void;
|
||||
hasMore: boolean;
|
||||
disableLoadMore: boolean;
|
||||
}
|
||||
|
||||
const Stream: StatelessComponent<StreamProps> = props => {
|
||||
if (props.comments === null) {
|
||||
// TODO: (@cvle) What's the reason for this being null?
|
||||
return <div>Comments unavailable</div>;
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<Logo gutterBottom />
|
||||
|
||||
Reference in New Issue
Block a user