import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; import {textWithMarkupMatcher} from 'sentry-test/utils'; import {ErrorItem} from 'sentry/components/events/errorItem'; describe('Issue error item', function () { it('expand subitems', async function () { render( ); expect(screen.getByText('A proguard mapping file was missing.')).toBeInTheDocument(); expect(screen.queryByText('Mapping Uuid')).not.toBeInTheDocument(); await userEvent.click(screen.getByLabelText('Expand')); expect(screen.getByText('Mapping Uuid')).toBeInTheDocument(); }); it('display redacted data', async function () { render( ); await userEvent.click(screen.getByLabelText('Expand')); expect(screen.getByText('File Name')).toBeInTheDocument(); expect(screen.getByText('File Path')).toBeInTheDocument(); expect(screen.getAllByText(/redacted/)).toHaveLength(2); await userEvent.hover(screen.getAllByText(/redacted/)[0]); expect( await screen.findByText( textWithMarkupMatcher( "Replaced because of a data scrubbing rule in your project's settings" ) ) // Fall back case ).toBeInTheDocument(); // tooltip description }); });