import React from 'react';
import { render, screen, within } from '@testing-library/react';
import { TransitiveMatchRulesTooltip } from './TransitiveMatchRulesTooltip';
describe('TransitiveMatchRulesTooltip tests', function () {
    var rules = [
        { label: 'label1', matchRules: [{ uri: 'uri1', label: 'label11' }] },
        { label: 'label2', matchRules: [{ uri: 'uri2', label: 'label22' }] }
    ];
    it('should render all rules', function () {
        render(React.createElement(TransitiveMatchRulesTooltip, { transitiveMatchRules: rules }));
        var matchRules = screen.getAllByTestId('match-rule-wrapper');
        expect(matchRules).toHaveLength(rules.length);
        expect(within(matchRules[0]).getByText('label1')).toBeInTheDocument();
        expect(within(matchRules[0]).getByText('Match rules')).toBeInTheDocument();
        expect(within(matchRules[0]).getByText('- label11')).toBeInTheDocument();
        expect(within(matchRules[1]).getByText('label2')).toBeInTheDocument();
        expect(within(matchRules[1]).getByText('Match rules')).toBeInTheDocument();
        expect(within(matchRules[1]).getByText('- label22')).toBeInTheDocument();
    });
});
