summaryrefslogtreecommitdiff
path: root/web-ui/src/common/header/header.spec.js
blob: 0c11713b2b98f92e1176a5335e4cb647352f1216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { shallow } from 'enzyme';
import expect from 'expect';
import React from 'react';
import { Header } from 'src/common/header/header';
import Logout from 'src/common/logout/logout';

describe('Header', () => {
  let header;

  beforeEach(() => {
    header = shallow(<Header />);
  });

  it('renders the header pixelated logo', () => {
    expect(header.find('header').find('img').props().alt).toEqual('Pixelated');
  });

  it('renders the header containing the logout button when renderLogout is true', () => {
    header = shallow(<Header renderLogout />);
    expect(header.find('header').find(Logout).length).toEqual(1);
  });

  it('hides logout button when renderLogout is false', () => {
    expect(header.find('header').find(Logout).length).toEqual(0);
  });
});