diff options
author | Anike Arni <anikarni@gmail.com> | 2017-02-08 13:51:11 -0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-08 13:51:11 -0200 |
commit | a1c384cebd80e177389ef79c2de6400db986aaa6 (patch) | |
tree | 7d2e14fbf931fd50769510bfc5809f41e5c48dbf /web-ui/test | |
parent | 48e5acd386123a06586c20bf192fc18b5471da13 (diff) | |
parent | aa26a47abac48d817a04a4f2375f1378767fa83c (diff) |
Merge pull request #964 from pixelated/backup-email-page
Refactoring react code
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/jasmine.json | 9 | ||||
-rw-r--r-- | web-ui/test/spec/account_recovery/page.spec.js | 12 | ||||
-rw-r--r-- | web-ui/test/test-main.js | 2 | ||||
-rw-r--r-- | web-ui/test/unit/account_recovery/page.spec.js | 25 |
4 files changed, 26 insertions, 22 deletions
diff --git a/web-ui/test/jasmine.json b/web-ui/test/jasmine.json deleted file mode 100644 index 969304b6..00000000 --- a/web-ui/test/jasmine.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "spec_dir": "test/spec/account_recovery/", - "spec_files": [ - "**/*[sS]pec.js" - ], - "helpers": [ - "helpers/**/*.js" - ] -} diff --git a/web-ui/test/spec/account_recovery/page.spec.js b/web-ui/test/spec/account_recovery/page.spec.js deleted file mode 100644 index 3e19f244..00000000 --- a/web-ui/test/spec/account_recovery/page.spec.js +++ /dev/null @@ -1,12 +0,0 @@ -import {shallow} from 'enzyme' -import expect from 'expect' -import React from 'react' -import { Page } from '../../../app/js/account_recovery/page' - -describe('Page', () => { - it('renders backup email page title', () => { - const mockT = key => key; - const page = shallow(<Page t={mockT}/>); - expect(page.find('h1').text()).toEqual('backup-account.title'); - }); -}); diff --git a/web-ui/test/test-main.js b/web-ui/test/test-main.js index b7dc430f..4396993f 100644 --- a/web-ui/test/test-main.js +++ b/web-ui/test/test-main.js @@ -1,7 +1,7 @@ var tests = Object.keys(window.__karma__.files).filter(function (file) { 'use strict'; - return !(/account_recovery/.test(file)) && (/\.spec\.js$/.test(file)); + return (/\.spec\.js$/.test(file)); }); beforeEach(function() { diff --git a/web-ui/test/unit/account_recovery/page.spec.js b/web-ui/test/unit/account_recovery/page.spec.js new file mode 100644 index 00000000..590d1de8 --- /dev/null +++ b/web-ui/test/unit/account_recovery/page.spec.js @@ -0,0 +1,25 @@ +import { shallow } from 'enzyme' +import expect from 'expect' +import React from 'react' +import { Page } from 'src/account_recovery/page' + +describe('Page', () => { + let mockT, page + + beforeEach(() => { + mockT = (key) => (key) + page = shallow(<Page t={mockT}/>) + }) + + it('renders backup email page title', () => { + expect(page.find('h1').text()).toEqual('backup-account.title') + }) + + it('renders backup account email input field', () => { + expect(page.find('InputField').props().name).toEqual('email') + }) + + it('renders backup account submit button', () => { + expect(page.find('SubmitButton').props().buttonText).toEqual('backup-account.button') + }) +}) |