0aa73ce4b1f4e562baaabf6a28320ca0a792cbaa
[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
19 import {
20     getCatalog,
21     getWorkflows,
22     getSort,
23     getQueryString
24 } from 'features/catalog/catalogSelectors';
25
26 describe('Catalog Selectors', () => {
27     const catalog = {
28         page: -1,
29         workflows: {
30             total: 2,
31             limit: 0,
32             offset: 0,
33             results: [
34                 {
35                     id: '755eab7752374a2380544065b59b082d',
36                     name: 'Alfa',
37                     description: 'description description 1',
38                     category: null
39                 },
40                 {
41                     id: 'ef8159204dac4c10a85b29ec30b4bd56',
42                     name: 'Bravo',
43                     description: 'description description 2',
44                     category: null
45                 }
46             ]
47         },
48         sort: {
49             name: 'ASC',
50             date: 'DESC'
51         }
52     };
53
54     it('returns catalog', () => {
55         const state = { catalog };
56
57         expect(getCatalog(state)).toEqual(catalog);
58     });
59
60     it('returns catalog workflows', () => {
61         const state = { catalog };
62
63         expect(getWorkflows(state)).toEqual(catalog.workflows);
64     });
65
66     it('returns catalog sort', () => {
67         const state = { catalog };
68
69         expect(getSort(state)).toEqual(catalog.sort);
70     });
71 });