909c876ac0d088b9cb3b97990ab66b0695b207a5
[sdc/sdc-workflow-designer.git] /
1 /*
2 * Copyright © 2018 European Support Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10  * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 'use strict';
18 import {
19     getWorkflowName,
20     getWorkflowDescription
21 } from 'features/workflow/workflowSelectors';
22 import { getWorkflowParams } from 'features/workflow/create/createWorkflowSelector';
23
24 describe('New workflow selectors', () => {
25     const workflow = {
26         data: {
27             name: 'workflow1',
28             description: 'description'
29         }
30     };
31
32     it('return workflow name', () => {
33         const state = { workflow };
34         expect(getWorkflowName(state)).toEqual(workflow.data.name);
35     });
36
37     it('return workflow description', () => {
38         const state = { workflow };
39         expect(getWorkflowDescription(state)).toEqual(
40             workflow.data.description
41         );
42     });
43
44     it('return workflow server params', () => {
45         const state = { workflow };
46         expect(getWorkflowParams(state)).toEqual({
47             name: getWorkflowName(state),
48             description: getWorkflowDescription(state)
49         });
50     });
51 });