@@ -21,11 +35,13 @@ function FeedItem(props) {
{props.review_text}
- {heartIcon} {props.likes} likes
+ {heartIcon} {props.likes} likes
+
+ {props.current_username === props.username &&
+
}
)
}
-
-export default FeedItem;
\ No newline at end of file
+export default FeedItem;
diff --git a/client/components/FeedItem.test.js b/client/components/FeedItem.test.js
new file mode 100644
index 0000000..6ecbb78
--- /dev/null
+++ b/client/components/FeedItem.test.js
@@ -0,0 +1,53 @@
+import React from 'react';
+import Enzyme, { shallow } from 'enzyme';
+import EnzymeAdapter from 'enzyme-adapter-react-16';
+import FeedItem from './FeedItem';
+
+Enzyme.configure({ adapter: new EnzymeAdapter() });
+
+const defaultProps = {
+ category: 'Food',
+ created_by: 29,
+ id: 193,
+ likes: 0,
+ location: '2nd Avenue, New York, NY, USA',
+ locationDetail: "Joey Pepperoni's Pizza",
+ rating: 5,
+ recommendation: 'Zac',
+ review_text: 'Food of the gods',
+ username: 'zach'
+};
+
+const setup = (props = {}) => {
+ const setupProps = { ...defaultProps, ...props };
+ return shallow(