From fec26b211a42b068e677ac5b43080bd4bf59e47a Mon Sep 17 00:00:00 2001 From: Thais Siqueira Date: Fri, 24 Feb 2017 14:27:31 -0300 Subject: [#907] Moves tests to directories components --- web-ui/package.json | 2 +- web-ui/src/backup_account/page.spec.js | 25 ++++++++++ web-ui/src/common/footer/footer.spec.js | 17 +++++++ web-ui/src/common/header/header.spec.js | 17 +++++++ web-ui/src/common/input_field/input_field.spec.js | 20 ++++++++ .../src/common/submit_button/submit_button.spec.js | 16 +++++++ web-ui/src/common/util.spec.js | 20 ++++++++ web-ui/src/login/about/welcome.spec.js | 17 +++++++ web-ui/src/login/error/auth_error.spec.js | 17 +++++++ web-ui/src/login/error/generic_error.spec.js | 17 +++++++ web-ui/src/login/page.spec.js | 53 ++++++++++++++++++++++ web-ui/test/unit/backup_account/page.spec.js | 25 ---------- web-ui/test/unit/common/footer/footer.spec.js | 17 ------- web-ui/test/unit/common/header/header.spec.js | 17 ------- .../unit/common/input_field/input_field.spec.js | 20 -------- .../common/submit_button/submit_button.spec.js | 16 ------- web-ui/test/unit/common/util.spec.js | 20 -------- web-ui/test/unit/login/about/welcome.spec.js | 17 ------- web-ui/test/unit/login/error/auth_error.spec.js | 17 ------- web-ui/test/unit/login/error/generic_error.spec.js | 17 ------- web-ui/test/unit/login/page.spec.js | 53 ---------------------- 21 files changed, 220 insertions(+), 220 deletions(-) create mode 100644 web-ui/src/backup_account/page.spec.js create mode 100644 web-ui/src/common/footer/footer.spec.js create mode 100644 web-ui/src/common/header/header.spec.js create mode 100644 web-ui/src/common/input_field/input_field.spec.js create mode 100644 web-ui/src/common/submit_button/submit_button.spec.js create mode 100644 web-ui/src/common/util.spec.js create mode 100644 web-ui/src/login/about/welcome.spec.js create mode 100644 web-ui/src/login/error/auth_error.spec.js create mode 100644 web-ui/src/login/error/generic_error.spec.js create mode 100644 web-ui/src/login/page.spec.js delete mode 100644 web-ui/test/unit/backup_account/page.spec.js delete mode 100644 web-ui/test/unit/common/footer/footer.spec.js delete mode 100644 web-ui/test/unit/common/header/header.spec.js delete mode 100644 web-ui/test/unit/common/input_field/input_field.spec.js delete mode 100644 web-ui/test/unit/common/submit_button/submit_button.spec.js delete mode 100644 web-ui/test/unit/common/util.spec.js delete mode 100644 web-ui/test/unit/login/about/welcome.spec.js delete mode 100644 web-ui/test/unit/login/error/auth_error.spec.js delete mode 100644 web-ui/test/unit/login/error/generic_error.spec.js delete mode 100644 web-ui/test/unit/login/page.spec.js (limited to 'web-ui') diff --git a/web-ui/package.json b/web-ui/package.json index 63272743..a9cb9604 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -80,7 +80,7 @@ "test:unit": "npm run test:coverage && npm run test:karma", "test:integration": "mocha-webpack --webpack-config webpack.test.config.js --require test/integration/setup.js \"test/integration/**/*.spec.js\"", "test:coverage": "NODE_ENV=test nyc --check-coverage npm run test:mocha", - "test:mocha": "mocha-webpack --webpack-config webpack.test.config.js \"test/unit/**/*.spec.js\"", + "test:mocha": "mocha-webpack --webpack-config webpack.test.config.js \"src/**/*.spec.js\"", "test:karma": "karma start --single-run $GRUNT_OPTS", "test:watch:mocha": "npm run test:mocha -- --watch", "test:watch:karma": "karma start", diff --git a/web-ui/src/backup_account/page.spec.js b/web-ui/src/backup_account/page.spec.js new file mode 100644 index 00000000..66d2dc78 --- /dev/null +++ b/web-ui/src/backup_account/page.spec.js @@ -0,0 +1,25 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { Page } from 'src/backup_account/page'; + +describe('Page', () => { + let page; + + beforeEach(() => { + const mockTranslations = key => key; + page = shallow(); + }); + + 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'); + }); +}); diff --git a/web-ui/src/common/footer/footer.spec.js b/web-ui/src/common/footer/footer.spec.js new file mode 100644 index 00000000..f1247233 --- /dev/null +++ b/web-ui/src/common/footer/footer.spec.js @@ -0,0 +1,17 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { Footer } from 'src/common/footer/footer'; + +describe('Footer', () => { + let footer; + + beforeEach(() => { + const mockTranslations = key => key; + footer = shallow(