summaryrefslogtreecommitdiff
path: root/web-ui/test/unit/login/app.spec.js
blob: 347e2b190b95371da4e6b793230b111a503d377a (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 { App } from 'src/login/app';

describe('App', () => {
  let app;
  const mockTranslations = key => key;

  beforeEach(() => {
    app = shallow(<App t={mockTranslations} />);
  });

  it('renders login form', () => {
    expect(app.find('form').props().action).toEqual('/login');
  });

  it('renders auth error message', () => {
    app = shallow(<App t={mockTranslations} authError />);
    expect(app.find('.error').length).toEqual(1);
  });

  it('does not render auth error message', () => {
    expect(app.find('.error').length).toEqual(0);
  });
});