Skip to content

Commit ed5de2e

Browse files
committed
testing
1 parent ed5435b commit ed5de2e

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

static/app/components/events/groupingInfo/groupingInfoSection.spec.tsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,59 @@ describe('EventGroupingInfo', () => {
6767
// Should not make grouping-info request
6868
expect(groupingInfoRequest).not.toHaveBeenCalled();
6969
});
70+
71+
it('works with new groupingInfo format', async () => {
72+
groupingInfoRequest = MockApiClient.addMockResponse({
73+
url: `/projects/org-slug/project-slug/events/${event.id}/grouping-info/`,
74+
body: {
75+
grouping_config: 'default:XXXX',
76+
variants: {
77+
app: {
78+
contributes: true,
79+
description: 'variant description',
80+
hash: '123',
81+
hashMismatch: false,
82+
key: 'key',
83+
type: EventGroupVariantType.CHECKSUM,
84+
},
85+
},
86+
},
87+
});
88+
render(<EventGroupingInfoSection {...defaultProps} />);
89+
90+
expect(await screen.findByText('variant description')).toBeInTheDocument();
91+
expect(screen.getByText('123')).toBeInTheDocument();
92+
});
93+
it('gets performance new grouping info from group/event data', async () => {
94+
groupingInfoRequest = MockApiClient.addMockResponse({
95+
url: `/projects/org-slug/project-slug/events/${event.id}/grouping-info/`,
96+
body: {
97+
grouping_config: null,
98+
variants: {
99+
app: {
100+
contributes: true,
101+
description: 'variant description',
102+
hash: '123',
103+
hashMismatch: false,
104+
key: 'key',
105+
type: EventGroupVariantType.CHECKSUM,
106+
},
107+
},
108+
},
109+
});
110+
const perfEvent = EventFixture({
111+
type: 'transaction',
112+
occurrence: {fingerprint: ['123'], evidenceData: {op: 'bad-op'}},
113+
});
114+
const perfGroup = GroupFixture({issueCategory: IssueCategory.PERFORMANCE});
115+
116+
render(
117+
<EventGroupingInfoSection {...defaultProps} event={perfEvent} group={perfGroup} />
118+
);
119+
120+
expect(await screen.findByText('performance problem')).toBeInTheDocument();
121+
expect(screen.getByText('123')).toBeInTheDocument();
122+
// Should not make grouping-info request
123+
expect(groupingInfoRequest).not.toHaveBeenCalled();
124+
});
70125
});

0 commit comments

Comments
 (0)