GH-6448 Migrate edit_command.jsx to be pure and use Redux (#6858)

* Migrate edit_command.jsx to be pure and use Redux, add basic test

* Update newCommand to reference modified command

* Fix typo

* Remove unnecessary re-renders
Этот коммит содержится в:
94117nl
2017-07-31 07:26:04 -05:00
коммит произвёл Joram Wilander
родитель f740698dbe
Коммит 6ec24867bc
5 изменённых файлов: 586 добавлений и 100 удалений

Просмотреть файл

@@ -0,0 +1,36 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React from 'react';
import {shallow} from 'enzyme';
import EditCommand from 'components/integrations/components/edit_command/edit_command.jsx';
describe('components/integrations/EditCommand', () => {
test('should match snapshot', () => {
const emptyFunction = jest.fn();
const id = 'r5tpgt4iepf45jt768jz84djic';
global.window.mm_config = {};
global.window.mm_config.EnableCommands = 'true';
const wrapper = shallow(
<EditCommand
team={{
id,
name: 'test'
}}
commandId={id}
commands={[]}
editCommandRequest={{
status: 'not_started',
error: null
}}
actions={{
getCustomTeamCommands: emptyFunction,
editCommand: emptyFunction
}}
/>
);
expect(wrapper).toMatchSnapshot();
});
});