1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00
metamask-extension/ui/components/app/app-loading-spinner/app-loading-spinner.test.js

28 lines
771 B
JavaScript

import React from 'react';
import { screen } from '@testing-library/react';
import { renderWithProvider } from '../../../../test/lib/render-helpers';
import configureStore from '../../../store/store';
import AppLoadingSpinner from './app-loading-spinner';
const render = (params) => {
const store = configureStore({
...params,
});
return renderWithProvider(<AppLoadingSpinner />, store);
};
describe('AppLoadingSpinner', () => {
it('should return null if app state is not loading', () => {
render();
expect(screen.queryByRole('alert')).not.toBeInTheDocument();
});
it('should show spinner if app state is loading', () => {
render({ appState: { isLoading: true } });
expect(screen.queryByRole('alert')).toBeInTheDocument();
});
});