diff --git a/ui/src/components/avatar/index.js b/ui/src/components/avatar/index.js
index 4d6f48b7..12ccd5d7 100644
--- a/ui/src/components/avatar/index.js
+++ b/ui/src/components/avatar/index.js
@@ -7,7 +7,7 @@ const styles = require('./style.css');
const Avatar = ({
color,
src,
- name,
+ name = '',
className,
style
}) => {
@@ -22,32 +22,26 @@ const Avatar = ({
background: color
};
- const fill = () => {
- if ( src ) {
- return (
-
- );
- } else {
- const letter = name.split('')[0];
- return (
-
- {letter}
-
- );
- }
- };
+ const letter = name.split('')[0];
+ const av = src ? (
+
+ ) : (
+
+ {letter}
+
+ );
return (
- {fill()}
+ {av}
);
};
diff --git a/ui/test/index.js b/ui/test/index.js
index 7895e316..235ad943 100644
--- a/ui/test/index.js
+++ b/ui/test/index.js
@@ -6,8 +6,38 @@ const {
shallow
} = enzyme;
+test('renders without exploding', (t) => {
+ const Avatar = require('../src/components/avatar');
+ const wrapper = shallow();
+ t.deepEqual(wrapper.length, 1);
+});
+
test('renders without exploding', (t) => {
const Base = require('../src/components/base');
const wrapper = shallow();
t.deepEqual(wrapper.length, 1);
});
+
+test('renders