summaryrefslogtreecommitdiff
path: root/web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js
blob: 6df392faac6db672bd32904a271cef48a1b56496 (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
27
28
29
import { shallow } from 'enzyme';
import expect from 'expect';
import React from 'react';
import { AdminRecoveryCodeForm } from 'src/account_recovery/forms/admin_recovery_code_form';

describe('AdminRecoveryCodeForm', () => {
  let adminRecoveryCodeForm;

  beforeEach(() => {
    const mockTranslations = key => key;
    adminRecoveryCodeForm = shallow(<AdminRecoveryCodeForm t={mockTranslations} />);
  });

  it('renders title for admin recovery code', () => {
    expect(adminRecoveryCodeForm.find('h1').text()).toEqual('account-recovery.admin-form.title');
  });

  it('renders tips for retrieving recovery code', () => {
    expect(adminRecoveryCodeForm.find('li').length).toEqual(3);
  });

  it('renders input field for admin code', () => {
    expect(adminRecoveryCodeForm.find('InputField').props().name).toEqual('admin-code');
  });

  it('renders button for next step', () => {
    expect(adminRecoveryCodeForm.find('SubmitButton').props().buttonText).toEqual('account-recovery.admin-form.button');
  });
});