summaryrefslogtreecommitdiff
path: root/web-ui/src/account_recovery/backup_account_step/backup_account_step.spec.js
blob: 561079c9d6cf6f05832f6f638dda471c39671797 (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
30
31
import { shallow } from 'enzyme';
import expect from 'expect';
import React from 'react';
import { BackupAccountStep } from './backup_account_step';
import SubmitButton from 'src/common/submit_button/submit_button';

describe('BackupAccountStep', () => {
  let backupAccountStep;

  beforeEach(() => {
    const mockTranslations = key => key;
    backupAccountStep = shallow(<BackupAccountStep t={mockTranslations} />);
  });

  it('renders title for backup account step', () => {
    expect(backupAccountStep.find('h1').text()).toEqual('account-recovery.backup-account-step.title');
  });

  it('renders submit button with given href', () => {
    expect(backupAccountStep.find(SubmitButton).props().href).toEqual('/backup-account');
  });

  it('renders submit button with given container element', () => {
    expect(backupAccountStep.find(SubmitButton).props().containerElement).toEqual('a');
  });

  it('renders submit button with given button text', () => {
    expect(backupAccountStep.find(SubmitButton).props().buttonText)
      .toEqual('account-recovery.backup-account-step.buttonText');
  });
});