diff --git a/src/client/components/global_header/Header.tsx b/src/client/components/global_header/Header.tsx index 4593e4e..fd254f0 100644 --- a/src/client/components/global_header/Header.tsx +++ b/src/client/components/global_header/Header.tsx @@ -98,7 +98,8 @@ export class Header extends Component { if (res) { const avatarOption = res.profile.userdata.avatarOption; const gravatarHash = res.profile.synced.gravatarHash; - const gravatarDefault = res.profile.userdata.gravatarDefault; + const gravatarDefault = + res.profile.userdata.gravatarDefault || 'identicon'; const username = res.user.username; const realname = res.user.realname; this.setState({ diff --git a/src/client/components/global_header/__tests__/Header.spec.tsx b/src/client/components/global_header/__tests__/Header.spec.tsx new file mode 100644 index 0000000..1dfbd20 --- /dev/null +++ b/src/client/components/global_header/__tests__/Header.spec.tsx @@ -0,0 +1,13 @@ +/** + * @jest-environment jsdom + */ + +import React from 'react'; +import { shallow } from 'enzyme'; + +import { Header } from '../Header'; + +describe('Header tests', () => { + it('
should render', () => + expect(shallow(
)).toBeTruthy()); +});