import React from 'react';
import { renderInAppContext } from '@theorchard/suite-testing';
import BulkSessionsCard from '..';
import { ButtonType, IconType } from '../types';

describe('<BulkSessionsCard />', () => {
    const createdAt = '3 June 2024';
    const fileName = 'file-name.xyz';
    const sessionId = '';

    describe('Component renders', () => {
        test('matches snapshot for case 1', () => {
            const component = renderInAppContext(
                <BulkSessionsCard
                    titleText="Metadata Upload Complete"
                    iconType={IconType.Success}
                    buttonType={ButtonType.View}
                    createdAt={createdAt}
                    fileName={fileName}
                    sessionId={sessionId}
                />
            );
            expect(component).toMatchSnapshot();
        });
        test('matches snapshot for case 2', () => {
            const component = renderInAppContext(
                <BulkSessionsCard
                    titleText="450 Products are being Created"
                    bodyText="We will notify you via email when complete and you can view them in your Catalog."
                    iconType={IconType.Loading}
                    createdAt={createdAt}
                    fileName={fileName}
                />
            );
            expect(component).toMatchSnapshot();
        });
        test('matches snapshot for case 3', () => {
            const component = renderInAppContext(
                <BulkSessionsCard
                    titleText="Product Creation Failed"
                    bodyText="Download the report to see details. Please reach out to product-support@sonymusic-pde.com for assistance."
                    iconType={IconType.Warning}
                    buttonType={ButtonType.Report}
                    createdAt={createdAt}
                    fileName={fileName}
                    downloadLink="a valid report download link"
                />
            );
            expect(component).toMatchSnapshot();
        });
        test('matches snapshot for case 4', () => {
            const component = renderInAppContext(
                <BulkSessionsCard
                    titleText="Bulk Creation Complete"
                    iconType={IconType.Success}
                    createdAt={createdAt}
                    fileName={fileName}
                />
            );
            expect(component).toMatchSnapshot();
        });
    });
});
