123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- import {initializeOrg} from 'sentry-test/initializeOrg';
- import {render} from 'sentry-test/reactTestingLibrary';
- import EventOrGroupExtraDetails from 'sentry/components/eventOrGroupExtraDetails';
- describe('EventOrGroupExtraDetails', function () {
- const {routerContext} = initializeOrg();
- it('renders last and first seen', function () {
- const {container} = render(
- <EventOrGroupExtraDetails
- data={{
- orgId: 'orgId',
- projectId: 'projectId',
- groupId: 'groupId',
- lastSeen: '2017-07-25T22:56:12Z',
- firstSeen: '2017-07-01T02:06:02Z',
- }}
- />,
- {context: routerContext}
- );
- expect(container).toSnapshot();
- });
- it('renders only first seen', function () {
- const {container} = render(
- <EventOrGroupExtraDetails
- data={{
- orgId: 'orgId',
- projectId: 'projectId',
- groupId: 'groupId',
- firstSeen: '2017-07-01T02:06:02Z',
- }}
- />,
- {context: routerContext}
- );
- expect(container).toSnapshot();
- });
- it('renders only last seen', function () {
- const {container} = render(
- <EventOrGroupExtraDetails
- data={{
- orgId: 'orgId',
- projectId: 'projectId',
- groupId: 'groupId',
- lastSeen: '2017-07-25T22:56:12Z',
- }}
- />,
- {context: routerContext}
- );
- expect(container).toSnapshot();
- });
- it('renders all details', function () {
- const {container} = render(
- <EventOrGroupExtraDetails
- data={{
- orgId: 'orgId',
- projectId: 'projectId',
- groupId: 'groupId',
- lastSeen: '2017-07-25T22:56:12Z',
- firstSeen: '2017-07-01T02:06:02Z',
- numComments: 14,
- shortId: 'shortId',
- logger: 'javascript logger',
- annotations: ['annotation1', 'annotation2'],
- assignedTo: {
- name: 'Assignee Name',
- },
- status: 'resolved',
- }}
- />,
- {context: routerContext}
- );
- expect(container).toSnapshot();
- });
- it('renders assignee and status', function () {
- const {container} = render(
- <EventOrGroupExtraDetails
- data={{
- orgId: 'orgId',
- projectId: 'projectId',
- groupId: 'groupId',
- lastSeen: '2017-07-25T22:56:12Z',
- firstSeen: '2017-07-01T02:06:02Z',
- numComments: 14,
- shortId: 'shortId',
- logger: 'javascript logger',
- annotations: ['annotation1', 'annotation2'],
- assignedTo: {
- name: 'Assignee Name',
- },
- status: 'resolved',
- showStatus: true,
- }}
- showAssignee
- />,
- {context: routerContext}
- );
- expect(container).toSnapshot();
- });
- it('details when mentioned', function () {
- const {container} = render(
- <EventOrGroupExtraDetails
- data={{
- orgId: 'orgId',
- projectId: 'projectId',
- groupId: 'groupId',
- lastSeen: '2017-07-25T22:56:12Z',
- firstSeen: '2017-07-01T02:06:02Z',
- numComments: 14,
- shortId: 'shortId',
- logger: 'javascript logger',
- annotations: ['annotation1', 'annotation2'],
- subscriptionDetails: {reason: 'mentioned'},
- }}
- />,
- {context: routerContext}
- );
- expect(container).toSnapshot();
- });
- });
|