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
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
f740698dbe
Коммит
6ec24867bc
36
webapp/tests/components/integrations/edit_command.test.jsx
Обычный файл
36
webapp/tests/components/integrations/edit_command.test.jsx
Обычный файл
@@ -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();
|
||||
});
|
||||
});
|
||||
Ссылка в новой задаче
Block a user