5dfb57379793a1e0ea16e2102b93632fa63520f8
[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 VersionControllerView from 'features/version/versionController/VersionControllerView';
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                 creationTime: 1530687330460,
31                 modificationTime: 1530687330575,
32                 archivedStatus: 'ACTIVE'
33             },
34             {
35                 id: '7b5f6b086613470985082df2c0f6c666',
36                 name: '2.0',
37                 description:
38                     'Test version, bug fix for previous version that fixed an exception when the port was occupied',
39                 status: 'Draft',
40                 creationTime: 1530687330461,
41                 modificationTime: 1530687330576,
42                 archivedStatus: 'ACTIVE',
43                 baseId: '7b5f6b086613470985082df2c0f6c713'
44             }
45         ];
46         const tree = renderer
47             .create(
48                 <VersionControllerView
49                     viewableVersions={versionList}
50                     currentWorkflowVersion={versionList[0]}
51                 />
52             )
53             .toJSON();
54
55         expect(tree).toMatchSnapshot();
56     });
57 });