blob: bd7bb88488e8c11398408bbb257adec85b3b7a2a (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
import { shallow } from 'enzyme';
import expect from 'expect';
import React from 'react';
import { Page } from 'src/backup_account/page';
import BackupEmail from 'src/backup_account/backup_email/backup_email';
import Confirmation from 'src/backup_account/confirmation/confirmation';
describe('BackupAccount', () => {
let page;
beforeEach(() => {
const mockTranslations = key => key;
page = shallow(<Page t={mockTranslations} />);
});
it('renders backup account page title', () => {
expect(page.props().title).toEqual('backup-account.page-title');
});
describe('save backup email', () => {
let pageInstance;
beforeEach(() => {
pageInstance = page.instance();
});
it('verifies initial state', () => {
expect(pageInstance.state.status).toEqual('');
});
it('changes state', () => {
pageInstance.saveBackupEmail('success');
expect(pageInstance.state.status).toEqual('success');
});
it('renders backup email component', () => {
expect(page.find(BackupEmail).length).toEqual(1);
});
it('renders confirmation component', () => {
pageInstance.saveBackupEmail('success');
expect(page.find(Confirmation).length).toEqual(1);
});
});
});
|