diff options
Diffstat (limited to 'web-ui/test/unit/login/app.spec.js')
-rw-r--r-- | web-ui/test/unit/login/app.spec.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/web-ui/test/unit/login/app.spec.js b/web-ui/test/unit/login/app.spec.js new file mode 100644 index 00000000..347e2b19 --- /dev/null +++ b/web-ui/test/unit/login/app.spec.js @@ -0,0 +1,26 @@ +import { shallow } from 'enzyme'; +import expect from 'expect'; +import React from 'react'; +import { App } from 'src/login/app'; + +describe('App', () => { + let app; + const mockTranslations = key => key; + + beforeEach(() => { + app = shallow(<App t={mockTranslations} />); + }); + + it('renders login form', () => { + expect(app.find('form').props().action).toEqual('/login'); + }); + + it('renders auth error message', () => { + app = shallow(<App t={mockTranslations} authError />); + expect(app.find('.error').length).toEqual(1); + }); + + it('does not render auth error message', () => { + expect(app.find('.error').length).toEqual(0); + }); +}); |