@@ -16,7 +16,7 @@ describe('messageSpanSamplesPanel', () => {
16
16
let eventsRequestMock : jest . Mock ;
17
17
let eventsStatsRequestMock : jest . Mock ;
18
18
let samplesRequestMock : jest . Mock ;
19
- let spanFieldTagsMock : jest . Mock ;
19
+ let traceItemAttributesMock : jest . Mock ;
20
20
21
21
jest . mocked ( usePageFilters ) . mockReturnValue (
22
22
PageFilterStateFixture ( {
@@ -124,8 +124,8 @@ describe('messageSpanSamplesPanel', () => {
124
124
} ,
125
125
} ) ;
126
126
127
- spanFieldTagsMock = MockApiClient . addMockResponse ( {
128
- url : `/organizations/${ organization . slug } /spans/fields /` ,
127
+ traceItemAttributesMock = MockApiClient . addMockResponse ( {
128
+ url : `/organizations/${ organization . slug } /trace-items/attributes /` ,
129
129
method : 'GET' ,
130
130
body : [
131
131
{
@@ -139,11 +139,6 @@ describe('messageSpanSamplesPanel', () => {
139
139
] ,
140
140
} ) ;
141
141
142
- MockApiClient . addMockResponse ( {
143
- url : '/organizations/org-slug/trace-items/attributes/' ,
144
- body : [ ] ,
145
- } ) ;
146
-
147
142
MockApiClient . addMockResponse ( {
148
143
url : `/organizations/${ organization . slug } /recent-searches/` ,
149
144
body : [ ] ,
@@ -230,15 +225,31 @@ describe('messageSpanSamplesPanel', () => {
230
225
} ) ,
231
226
} )
232
227
) ;
233
- expect ( spanFieldTagsMock ) . toHaveBeenNthCalledWith (
228
+ expect ( traceItemAttributesMock ) . toHaveBeenNthCalledWith (
234
229
1 ,
235
- `/organizations/${ organization . slug } /spans/fields /` ,
230
+ `/organizations/${ organization . slug } /trace-items/attributes /` ,
236
231
expect . objectContaining ( {
237
232
method : 'GET' ,
238
233
query : {
234
+ attributeType : 'number' ,
235
+ itemType : 'spans' ,
239
236
project : [ ] ,
240
- environment : [ ] ,
241
- statsPeriod : '1h' ,
237
+ statsPeriod : '10d' ,
238
+ substringMatch : undefined ,
239
+ } ,
240
+ } )
241
+ ) ;
242
+ expect ( traceItemAttributesMock ) . toHaveBeenNthCalledWith (
243
+ 2 ,
244
+ `/organizations/${ organization . slug } /trace-items/attributes/` ,
245
+ expect . objectContaining ( {
246
+ method : 'GET' ,
247
+ query : {
248
+ attributeType : 'string' ,
249
+ itemType : 'spans' ,
250
+ project : [ ] ,
251
+ statsPeriod : '10d' ,
252
+ substringMatch : undefined ,
242
253
} ,
243
254
} )
244
255
) ;
@@ -326,14 +337,31 @@ describe('messageSpanSamplesPanel', () => {
326
337
} ) ,
327
338
} )
328
339
) ;
329
- expect ( spanFieldTagsMock ) . toHaveBeenCalledWith (
330
- `/organizations/${ organization . slug } /spans/fields/` ,
340
+ expect ( traceItemAttributesMock ) . toHaveBeenNthCalledWith (
341
+ 1 ,
342
+ `/organizations/${ organization . slug } /trace-items/attributes/` ,
331
343
expect . objectContaining ( {
332
344
method : 'GET' ,
333
345
query : {
346
+ attributeType : 'number' ,
347
+ itemType : 'spans' ,
334
348
project : [ ] ,
335
- environment : [ ] ,
336
- statsPeriod : '1h' ,
349
+ statsPeriod : '10d' ,
350
+ substringMatch : undefined ,
351
+ } ,
352
+ } )
353
+ ) ;
354
+ expect ( traceItemAttributesMock ) . toHaveBeenNthCalledWith (
355
+ 2 ,
356
+ `/organizations/${ organization . slug } /trace-items/attributes/` ,
357
+ expect . objectContaining ( {
358
+ method : 'GET' ,
359
+ query : {
360
+ attributeType : 'string' ,
361
+ itemType : 'spans' ,
362
+ project : [ ] ,
363
+ statsPeriod : '10d' ,
364
+ substringMatch : undefined ,
337
365
} ,
338
366
} )
339
367
) ;
0 commit comments