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

describe('ProgressBar Component - ', () => {
    it('Renders correctly with basic required params', () => {
        const item = renderer.create(<ProgressBar valueMin={0} valueMax={100} valueNow={70} />).toJSON();
        expect(item).toMatchSnapshot();
    });
    it('Renders nothing when show is false', () => {
        const item = renderer.create(<ProgressBar valueMin={0} valueMax={100} valueNow={70}  show={false} />).toJSON();
        expect(item).toMatchSnapshot();
    });
    it('Applies the passed className to the parent div', () => {
        const item = renderer.create(<ProgressBar className="test-class" valueMin={0} valueMax={100} valueNow={70} />).toJSON();
        expect(item).toMatchSnapshot();
    });
    it('Applies the passed progressBarClassName to the div with role=progressbar', () => {
        const item = renderer.create(<ProgressBar progressBarClassName="test-progress-class" valueMin={0} valueMax={100} valueNow={70} />).toJSON();
        expect(item).toMatchSnapshot();
    });
    it('Applies the passed progressBarLabel instead of sr-only % label', () => {
        const item = renderer.create(<ProgressBar progressBarLabel="Verifying Upload" valueMin={0} valueMax={100} valueNow={70} />).toJSON();
        expect(item).toMatchSnapshot();
    });
});
