2bcfa300b8b1de22da9bfd6aa436f1a30477d41f
[sdc/sdc-workflow-designer.git] / workflow-designer-ui / src / main / frontend / src / features / version / versionController / __tests__ / VersionControllerView_snapshot-test.js
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 import React from 'react';
17 import renderer from 'react-test-renderer';
18
19 import VersionsContainer from 'features/version/versionController/views/VersionsContainer';
20
21 describe('Version Controller View Snapshot', () => {
22     it('renders correctly', () => {
23         const versionList = [
24             {
25                 id: '7b5f6b086613470985082df2c0f6c713',
26                 name: '1.0',
27                 description:
28                     'Initial version, bug fix for previous version that fixed an exception when the port was occupied',
29                 status: 'Draft',
30                 state: 'Draft',
31                 creationTime: 1530687330460,
32                 modificationTime: 1530687330575,
33                 archivedStatus: 'ACTIVE'
34             },
35             {
36                 id: '7b5f6b086613470985082df2c0f6c666',
37                 name: '2.0',
38                 description:
39                     'Test version, bug fix for previous version that fixed an exception when the port was occupied',
40                 status: 'Draft',
41                 state: 'Draft',
42                 creationTime: 1530687330461,
43                 modificationTime: 1530687330576,
44                 archivedStatus: 'ACTIVE',
45                 baseId: '7b5f6b086613470985082df2c0f6c713'
46             }
47         ];
48         const tree = renderer
49             .create(
50                 <VersionsContainer
51                     viewableVersions={versionList}
52                     currentWorkflowVersion={versionList[0]}
53                 />
54             )
55             .toJSON();
56
57         expect(tree).toMatchSnapshot();
58     });
59 });