diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:04:13 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:11:58 -0700 |
commit | d8bd57901e33a7057e26e782e295099ffcc0da89 (patch) | |
tree | e12dfc8cad42b1576756d19d7fbfd82646a009bf /webapp/tests/components/integrations/add_oauth_app.test.jsx | |
parent | 7bc8e9a08dfde56387f946fdf5086252aa4d0491 (diff) | |
download | chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.gz chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.bz2 chat-d8bd57901e33a7057e26e782e295099ffcc0da89.zip |
Removing webapp
Diffstat (limited to 'webapp/tests/components/integrations/add_oauth_app.test.jsx')
-rw-r--r-- | webapp/tests/components/integrations/add_oauth_app.test.jsx | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/webapp/tests/components/integrations/add_oauth_app.test.jsx b/webapp/tests/components/integrations/add_oauth_app.test.jsx deleted file mode 100644 index 11e743ff5..000000000 --- a/webapp/tests/components/integrations/add_oauth_app.test.jsx +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import React from 'react'; -import {shallow} from 'enzyme'; - -import AddOAuthApp from 'components/integrations/components/add_oauth_app/add_oauth_app.jsx'; - -describe('components/integrations/AddOAuthApp', () => { - const emptyFunction = jest.fn(); - const team = { - id: 'dbcxd9wpzpbpfp8pad78xj12pr', - name: 'test' - }; - - test('should match snapshot', () => { - const wrapper = shallow( - <AddOAuthApp - team={team} - addOAuthAppRequest={{ - status: 'not_started', - error: null - }} - actions={{addOAuthApp: emptyFunction}} - /> - ); - - expect(wrapper).toMatchSnapshot(); - }); - - test('should match snapshot, displays client error', () => { - const wrapper = shallow( - <AddOAuthApp - team={team} - addOAuthAppRequest={{ - status: 'not_started', - error: null - }} - actions={{addOAuthApp: emptyFunction}} - /> - ); - - wrapper.find('.btn-primary').simulate('click', {preventDefault() { - return jest.fn(); - }}); - - expect(wrapper).toMatchSnapshot(); - }); - - test('should call addOAuthApp function', () => { - const addOAuthApp = jest.genMockFunction().mockImplementation( - () => { - return new Promise((resolve) => { - process.nextTick(() => resolve()); - }); - } - ); - - const wrapper = shallow( - <AddOAuthApp - team={team} - addOAuthAppRequest={{ - status: 'not_started', - error: null - }} - actions={{addOAuthApp}} - /> - ); - - wrapper.find('#name').simulate('change', {target: {value: 'name'}}); - wrapper.find('#description').simulate('change', {target: {value: 'description'}}); - wrapper.find('#homepage').simulate('change', {target: {value: 'http://test.com'}}); - wrapper.find('#callbackUrls').simulate('change', {target: {value: 'http://callback.com'}}); - - wrapper.find('.btn-primary').simulate('click', {preventDefault() { - return jest.fn(); - }}); - - expect(addOAuthApp).toBeCalled(); - }); -});
\ No newline at end of file |