diff --git a/__tests__/components/SpinnerLoading.spec.ts b/__tests__/components/SpinnerLoading.spec.ts new file mode 100644 index 000000000..6e570bdaa --- /dev/null +++ b/__tests__/components/SpinnerLoading.spec.ts @@ -0,0 +1,64 @@ +/* + * (C) Symbol Contributors 2022 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + */ +import SpinnerLoading from '@/components/SpinnerLoading/SpinnerLoading.vue'; +import { getComponent } from '@MOCKS/Components'; +import { Spin } from 'view-design'; + +describe('components/SpinnerLoading', () => { + const getSpinnerLoadingWrapper = (state = {}) => { + const mockAppStore = { + namespaced: true, + state: { loadingOverlayMessage: '', loadingDisableCloseButton: false }, + getters: { + loadingOverlayMessage: (state) => state.loadingOverlayMessage, + loadingDisableCloseButton: (state) => state.loadingDisableCloseButton, + }, + }; + + return getComponent( + SpinnerLoading, + { + app: mockAppStore, + }, + { + ...state, + }, + {}, + {}, + undefined, + { + $Spin: Spin, + }, + ); + }; + + describe('closeScreen', () => { + test('store dispatches "app/SET_LOADING_OVERLAY" when provided close screen', () => { + // Arrange: + const wrapper = getSpinnerLoadingWrapper(); + + // Act: + // @ts-ignore + wrapper.vm.closeScreen(); + + // Assert: + expect(wrapper.vm.$store.dispatch).toBeCalledWith('app/SET_LOADING_OVERLAY', { + show: false, + message: '', + }); + }); + }); +}); diff --git a/src/components/SpinnerDots/SpinnerDots.less b/src/components/SpinnerDots/SpinnerDots.less deleted file mode 100644 index a6c52120e..000000000 --- a/src/components/SpinnerDots/SpinnerDots.less +++ /dev/null @@ -1,53 +0,0 @@ -.spinner { - width: 100%; - text-align: center; -} - -.spinner > div { - width: 10px; - height: 10px; - margin: 10px; - background-color: #ccc; - border-radius: 100%; - display: inline-block; - -webkit-animation: bounceDelay 1.4s infinite ease-in-out; - animation: bounceDelay 1.4s infinite ease-in-out; - /* Prevent first frame from flickering when animation starts */ - - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} - -.spinner .bounce1 { - -webkit-animation-delay: -0.32s; - animation-delay: -0.32s; -} - -.spinner .bounce2 { - -webkit-animation-delay: -0.16s; - animation-delay: -0.16s; -} - -@-webkit-keyframes bounceDelay { - 0%, - 80%, - 100% { - -webkit-transform: scale(0); - } - 40% { - -webkit-transform: scale(1); - } -} - -@keyframes bounceDelay { - 0%, - 80%, - 100% { - transform: scale(0); - -webkit-transform: scale(0); - } - 40% { - transform: scale(1); - -webkit-transform: scale(1); - } -} diff --git a/src/components/SpinnerDots/SpinnerDots.vue b/src/components/SpinnerDots/SpinnerDots.vue deleted file mode 100644 index cabf8c227..000000000 --- a/src/components/SpinnerDots/SpinnerDots.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - -