/**
 * @jest-environment jsdom
 */
import React from 'react';
import renderer from 'react-test-renderer';
import LoadingIndicator from '../LoadingIndicator';

describe('snapshot test - testing LoadingIndicator Component', () => {
    it('renders correctly', () => {
        const item = renderer.create(<LoadingIndicator />).toJSON();
        expect(item).toMatchSnapshot();
    });

    it('renders size and inline class names and props correctly', () => {
        const item = renderer.create(<LoadingIndicator show={true} size="sm" isInline={true}/>).toJSON();
        expect(item).toMatchSnapshot();
    });

    it('renders nothing when show attr is false', () => {
        const item = renderer.create(<LoadingIndicator show={false}/>).toJSON();
        expect(item).toMatchSnapshot();
    });

    it('renders message correctly', () => {
        const item = renderer.create(<LoadingIndicator message="test message"/>).toJSON();
        expect(item).toMatchSnapshot();
    });
});
