mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import {Fragment} from 'react';
|
|
import {EventFixture} from 'sentry-fixture/event';
|
|
import {EntryDebugMetaFixture} from 'sentry-fixture/eventEntry';
|
|
|
|
import {initializeOrg} from 'sentry-test/initializeOrg';
|
|
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import {DebugMeta} from 'sentry/components/events/interfaces/debugMeta';
|
|
import {getFileName} from 'sentry/components/events/interfaces/debugMeta/utils';
|
|
import GlobalModal from 'sentry/components/globalModal';
|
|
|
|
describe('DebugMeta', function () {
|
|
it('opens details modal', async function () {
|
|
const eventEntryDebugMeta = EntryDebugMetaFixture();
|
|
const event = EventFixture({entries: [eventEntryDebugMeta]});
|
|
const {organization, project, router} = initializeOrg();
|
|
const routerProps = {router, location: router.location};
|
|
|
|
render(
|
|
<Fragment>
|
|
<GlobalModal />
|
|
<DebugMeta
|
|
organization={organization}
|
|
projectSlug={project.slug}
|
|
event={event}
|
|
data={eventEntryDebugMeta.data}
|
|
{...routerProps}
|
|
/>
|
|
</Fragment>
|
|
);
|
|
|
|
await screen.findByRole('heading', {name: 'Images Loaded'});
|
|
|
|
await userEvent.click(screen.getByRole('button', {name: 'Show Details'}));
|
|
|
|
await userEvent.click(screen.getByRole('button', {name: 'View'}));
|
|
|
|
expect(
|
|
await screen.findByText(getFileName(eventEntryDebugMeta.data.images[0]?.code_file)!)
|
|
).toBeInTheDocument();
|
|
});
|
|
});
|