summaryrefslogtreecommitdiff
path: root/web-ui/test/unit/login/app.spec.js
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-02-23 11:34:14 -0300
committerAnike Arni <aarni@thoughtworks.com>2017-02-23 11:42:11 -0300
commit1997c401a5e67b76663d3996ec085eb6782c34e9 (patch)
tree5c445c20327351c5c0004fe4dc2a65143eec9612 /web-ui/test/unit/login/app.spec.js
parent5470cd7729f656fe2ed3a00d0cc301455d63d706 (diff)
[#907] Adds integration test for translations
For this test, we refactored the way translations were done for backup account and login, concentrating them in the common/app.js component. with @thaissiqueira
Diffstat (limited to 'web-ui/test/unit/login/app.spec.js')
-rw-r--r--web-ui/test/unit/login/app.spec.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/web-ui/test/unit/login/app.spec.js b/web-ui/test/unit/login/app.spec.js
deleted file mode 100644
index 39d21f04..00000000
--- a/web-ui/test/unit/login/app.spec.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import { shallow } from 'enzyme';
-import expect from 'expect';
-import React from 'react';
-import { App } from 'src/login/app';
-import AuthError from 'src/login/error/auth_error';
-import GenericError from 'src/login/error/generic_error';
-import PixelatedWelcome from 'src/login/about/pixelated_welcome';
-
-describe('App', () => {
- let app;
- const mockTranslations = key => key;
-
- it('renders login form', () => {
- app = shallow(<App t={mockTranslations} />);
- expect(app.find('form').props().action).toEqual('/login');
- });
-
- it('renders welcome message when no error', () => {
- app = shallow(<App t={mockTranslations} />);
- expect(app.find(PixelatedWelcome).length).toEqual(1);
- });
-
- it('renders auth error message', () => {
- app = shallow(<App t={mockTranslations} authError />);
- expect(app.find(AuthError).length).toEqual(1);
- });
-
- it('renders generic error message when error', () => {
- app = shallow(<App t={mockTranslations} error />);
- expect(app.find(GenericError).length).toEqual(1);
- });
-
- it('does not render welcome message when error', () => {
- app = shallow(<App t={mockTranslations} error />);
- expect(app.find(PixelatedWelcome).length).toEqual(0);
- });
-
- it('does not render error message', () => {
- app = shallow(<App t={mockTranslations} />);
- expect(app.find(AuthError).length).toEqual(0);
- expect(app.find(GenericError).length).toEqual(0);
- });
-
- it('adds small logo class when error', () => {
- app = shallow(<App t={mockTranslations} error />);
- expect(app.find('.logo').props().className).toEqual('logo small-logo');
- });
-
- it('does not add small logo class when no error', () => {
- app = shallow(<App t={mockTranslations} />);
- expect(app.find('.logo').props().className).toEqual('logo');
- });
-});