import {initializeOrg} from 'sentry-test/initializeOrg';
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
import {textWithMarkupMatcher} from 'sentry-test/utils';
import {ErrorItem} from 'sentry/components/events/errorItem';
import {OrganizationContext} from 'sentry/views/organizationContext';
import {RouteContext} from 'sentry/views/routeContext';
describe('Issue error item', function () {
it('expand subitems', function () {
const {organization, router} = initializeOrg();
render(
);
expect(screen.getByText('A proguard mapping file was missing.')).toBeInTheDocument();
expect(screen.queryByText('Mapping Uuid')).not.toBeInTheDocument();
userEvent.click(screen.getByLabelText('Expand'));
expect(screen.getByText('Mapping Uuid')).toBeInTheDocument();
});
it('display redacted data', async function () {
const {organization, router} = initializeOrg();
render(
);
userEvent.click(screen.getByLabelText('Expand'));
expect(screen.getByText('File Name')).toBeInTheDocument();
expect(screen.getByText('File Path')).toBeInTheDocument();
expect(screen.getAllByText(/redacted/)).toHaveLength(2);
userEvent.hover(screen.getAllByText(/redacted/)[0]);
expect(
await screen.findByText(
textWithMarkupMatcher('Replaced because of the PII rule project:2')
) // Fall back case
).toBeInTheDocument(); // tooltip description
});
});