eventMetas.spec.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {EventFixture} from 'sentry-fixture/event';
  2. import {LocationFixture} from 'sentry-fixture/locationFixture';
  3. import {OrganizationFixture} from 'sentry-fixture/organization';
  4. import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
  5. import EventMetas from './eventMetas';
  6. describe('EventMetas', () => {
  7. it('Displays event created and received dates when hovering', async () => {
  8. const event = EventFixture({
  9. dateReceived: '2017-05-21T18:01:48.762Z',
  10. dateCreated: '2017-05-21T18:02:48.762Z',
  11. });
  12. const organization = OrganizationFixture();
  13. MockApiClient.addMockResponse({
  14. url: '/organizations/org-slug/projects/',
  15. body: [],
  16. });
  17. render(
  18. <EventMetas
  19. event={event}
  20. location={LocationFixture()}
  21. organization={organization}
  22. errorDest="discover"
  23. transactionDest="discover"
  24. meta={null}
  25. projectId="1"
  26. quickTrace={null}
  27. />
  28. );
  29. await userEvent.hover(screen.getByText('5 months ago'));
  30. expect(await screen.findByText('Occurred')).toBeInTheDocument();
  31. expect(screen.getByText(/6:01:48 PM UTC/)).toBeInTheDocument();
  32. expect(screen.getByText('Received')).toBeInTheDocument();
  33. expect(screen.getByText(/6:02:48 PM UTC/)).toBeInTheDocument();
  34. });
  35. });