2 * Copyright © 2018 European Support Limited
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
25 showCustomModalAction,
27 } from 'shared/modal/modalWrapperActions';
29 describe('Modal Wrapper Actions', () => {
31 { fn: showInfoModalAction, type: 'info', size: 'small' },
32 { fn: showAlertModalAction, type: 'alert', size: 'small' },
33 { fn: showErrorModalAction, type: 'error', size: 'small' },
34 { fn: showCustomModalAction, type: 'custom', size: 'medium' }
37 it('returns correct action', () => {
38 actions.forEach(action => {
43 actionButtonText: 'Action Button Text',
44 actionButtonClick: () => {},
45 closeButtonText: 'Close Button Text'
57 expect(action.fn(payload)).toEqual(expected);
61 it('returns correct size in action', () => {
62 actions.forEach(action => {
71 payload: { size, type: action.type }
74 expect(action.fn(payload)).toEqual(expected);
78 it('returns hide modal action', () => {
83 expect(hideModalAction()).toEqual(expected);