import React from 'react';
import { renderInAppContext } from '@theorchard/suite-testing';
import { CrossAccountOsrConflictValidationMatch } from 'src/types';
import TrackOSRValidation from '../trackOSRValidation';

const mockedMatches: CrossAccountOsrConflictValidationMatch[] = [
    {
        tuid: 1,
        product_id: 2,
        upc: '321',
        vendor_id: 10,
        isrc: 'abc',
    },
];

describe('<TrackOSRValidation>', () => {
    const renderComponent = () =>
        renderInAppContext(
            <TrackOSRValidation matches={mockedMatches} code="some-mismatch" />
        );

    test('renders', () => {
        const { getByText, getByTestId } = renderComponent();
        expect(getByTestId('TrackOSRValidation')).toBeVisible();
        expect(getByText('321')).toBeInTheDocument();
    });
});
