summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTayane Fernandes <tayane.rmf@gmail.com>2017-03-15 18:51:52 -0300
committerTayane Fernandes <tayane.rmf@gmail.com>2017-03-16 10:28:45 -0300
commitdc84e6b2091dceb735aa82481edf83b6a5056adf (patch)
treed896384bd5e77409e013b7ae20e26b61a8e1889a
parent1e30557a74942bc0be71e55c7e6a25093f274d74 (diff)
[#971] Add tests for rendering backup account components
-rw-r--r--web-ui/src/backup_account/confirmation/confirmation.spec.js2
-rw-r--r--web-ui/src/backup_account/page.js2
-rw-r--r--web-ui/src/backup_account/page.spec.js13
3 files changed, 14 insertions, 3 deletions
diff --git a/web-ui/src/backup_account/confirmation/confirmation.spec.js b/web-ui/src/backup_account/confirmation/confirmation.spec.js
index c0ff7df2..291d156d 100644
--- a/web-ui/src/backup_account/confirmation/confirmation.spec.js
+++ b/web-ui/src/backup_account/confirmation/confirmation.spec.js
@@ -23,7 +23,7 @@ describe('Confirmation', () => {
expect(page.find('a').text()).toEqual('backup-account.confirmation.retry-button');
});
- it('retry button redirects to backup account', () => {
+ it('retries button redirects to backup account', () => {
expect(page.find('a').props().href).toEqual('/backup-account');
});
});
diff --git a/web-ui/src/backup_account/page.js b/web-ui/src/backup_account/page.js
index a32824d4..221c6978 100644
--- a/web-ui/src/backup_account/page.js
+++ b/web-ui/src/backup_account/page.js
@@ -52,7 +52,7 @@ export class Page extends React.Component {
<div className='page'>
<Header />
<section>
- {this.mainContent(t)}
+ {this.mainContent()}
</section>
<Footer />
</div>
diff --git a/web-ui/src/backup_account/page.spec.js b/web-ui/src/backup_account/page.spec.js
index 0868c671..23c117a0 100644
--- a/web-ui/src/backup_account/page.spec.js
+++ b/web-ui/src/backup_account/page.spec.js
@@ -2,6 +2,8 @@ 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;
@@ -22,7 +24,7 @@ describe('BackupAccount', () => {
pageInstance = page.instance();
});
- it('verify initial state', () => {
+ it('verifies initial state', () => {
expect(pageInstance.state.status).toEqual('');
});
@@ -30,5 +32,14 @@ describe('BackupAccount', () => {
pageInstance.saveBackupEmail();
expect(pageInstance.state.status).toEqual('success');
});
+
+ it('renders backup email component', () => {
+ expect(page.find(BackupEmail).length).toEqual(1);
+ });
+
+ it('renders confirmation component', () => {
+ pageInstance.saveBackupEmail();
+ expect(page.find(Confirmation).length).toEqual(1);
+ });
});
});