summaryrefslogtreecommitdiff
path: root/web-ui/test/unit/login/page.spec.js
diff options
context:
space:
mode:
authorThais Siqueira <thais.siqueira@gmail.com>2017-02-24 14:27:31 -0300
committerThais Siqueira <thais.siqueira@gmail.com>2017-02-24 14:27:31 -0300
commitfec26b211a42b068e677ac5b43080bd4bf59e47a (patch)
treee5bb685c1370e7e10cc707258fa235d953f426a3 /web-ui/test/unit/login/page.spec.js
parentfb4630207d86d39ea05dd679b2724be87597c518 (diff)
[#907] Moves tests to directories components
Diffstat (limited to 'web-ui/test/unit/login/page.spec.js')
-rw-r--r--web-ui/test/unit/login/page.spec.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/web-ui/test/unit/login/page.spec.js b/web-ui/test/unit/login/page.spec.js
deleted file mode 100644
index 0fe6f729..00000000
--- a/web-ui/test/unit/login/page.spec.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import { shallow } from 'enzyme';
-import expect from 'expect';
-import React from 'react';
-import { Page } from 'src/login/page';
-import AuthError from 'src/login/error/auth_error';
-import GenericError from 'src/login/error/generic_error';
-import Welcome from 'src/login/about/welcome';
-
-describe('Page', () => {
- let page;
- const mockTranslations = key => key;
-
- it('renders login form', () => {
- page = shallow(<Page t={mockTranslations} />);
- expect(page.find('form').props().action).toEqual('/login');
- });
-
- it('renders welcome message when no error', () => {
- page = shallow(<Page t={mockTranslations} />);
- expect(page.find(Welcome).length).toEqual(1);
- });
-
- it('renders auth error message', () => {
- page = shallow(<Page t={mockTranslations} authError />);
- expect(page.find(AuthError).length).toEqual(1);
- });
-
- it('renders generic error message when error', () => {
- page = shallow(<Page t={mockTranslations} error />);
- expect(page.find(GenericError).length).toEqual(1);
- });
-
- it('does not render welcome message when error', () => {
- page = shallow(<Page t={mockTranslations} error />);
- expect(page.find(Welcome).length).toEqual(0);
- });
-
- it('does not render error message', () => {
- page = shallow(<Page t={mockTranslations} />);
- expect(page.find(AuthError).length).toEqual(0);
- expect(page.find(GenericError).length).toEqual(0);
- });
-
- it('adds small logo class when error', () => {
- page = shallow(<Page t={mockTranslations} error />);
- expect(page.find('.logo').props().className).toEqual('logo small-logo');
- });
-
- it('does not add small logo class when no error', () => {
- page = shallow(<Page t={mockTranslations} />);
- expect(page.find('.logo').props().className).toEqual('logo');
- });
-});