@@ -318,9 +318,13 @@ describe('NotificationSettingsByType', function () {
318
318
} ) ;
319
319
320
320
it ( 'spend notifications on org with am3 with spend visibility notifications' , async function ( ) {
321
- const organization = OrganizationFixture ( ) ;
322
- organization . features . push ( 'spend-visibility-notifications' ) ;
323
- organization . features . push ( 'am3-tier' ) ;
321
+ const organization = OrganizationFixture ( {
322
+ features : [
323
+ 'spend-visibility-notifications' ,
324
+ 'am3-tier' ,
325
+ 'continuous-profiling-billing' ,
326
+ ] ,
327
+ } ) ;
324
328
renderComponent ( {
325
329
notificationType : 'quota' ,
326
330
organizations : [ organization ] ,
@@ -333,7 +337,8 @@ describe('NotificationSettingsByType', function () {
333
337
expect ( screen . getByText ( 'Session Replays' ) ) . toBeInTheDocument ( ) ;
334
338
expect ( screen . getByText ( 'Attachments' ) ) . toBeInTheDocument ( ) ;
335
339
expect ( screen . getByText ( 'Spend Allocations' ) ) . toBeInTheDocument ( ) ;
336
- expect ( screen . queryByText ( 'Continuous Profiling' ) ) . not . toBeInTheDocument ( ) ; // TODO(Continuous Profiling GA): should be in document
340
+ expect ( screen . getByText ( 'Profile Hours' , { exact : true } ) ) . toBeInTheDocument ( ) ;
341
+ expect ( screen . getByText ( 'UI Profile Hours' , { exact : true } ) ) . toBeInTheDocument ( ) ;
337
342
expect ( screen . queryByText ( 'Transactions' ) ) . not . toBeInTheDocument ( ) ;
338
343
339
344
const editSettingMock = MockApiClient . addMockResponse ( {
@@ -366,9 +371,13 @@ describe('NotificationSettingsByType', function () {
366
371
} ) ;
367
372
368
373
it ( 'spend notifications on org with am3 and org without am3' , async function ( ) {
369
- const organization = OrganizationFixture ( ) ;
370
- organization . features . push ( 'spend-visibility-notifications' ) ;
371
- organization . features . push ( 'am3-tier' ) ;
374
+ const organization = OrganizationFixture ( {
375
+ features : [
376
+ 'spend-visibility-notifications' ,
377
+ 'am3-tier' ,
378
+ 'continuous-profiling-billing' ,
379
+ ] ,
380
+ } ) ;
372
381
const otherOrganization = OrganizationFixture ( ) ;
373
382
renderComponent ( {
374
383
notificationType : 'quota' ,
@@ -383,13 +392,15 @@ describe('NotificationSettingsByType', function () {
383
392
expect ( screen . getByText ( 'Attachments' ) ) . toBeInTheDocument ( ) ;
384
393
expect ( screen . getByText ( 'Spend Allocations' ) ) . toBeInTheDocument ( ) ;
385
394
expect ( screen . getByText ( 'Transactions' ) ) . toBeInTheDocument ( ) ;
386
- expect ( screen . queryByText ( 'Continuous Profiling' ) ) . not . toBeInTheDocument ( ) ; // TODO(Continuous Profiling GA): should be in document
395
+ expect ( screen . getByText ( 'Profile Hours' , { exact : true } ) ) . toBeInTheDocument ( ) ;
396
+ expect ( screen . getByText ( 'UI Profile Hours' , { exact : true } ) ) . toBeInTheDocument ( ) ;
387
397
} ) ;
388
398
389
399
it ( 'spend notifications on org with am1 org only' , async function ( ) {
390
400
const organization = OrganizationFixture ( ) ;
391
401
organization . features . push ( 'spend-visibility-notifications' ) ;
392
402
organization . features . push ( 'am1-tier' ) ;
403
+ organization . features . push ( 'continuous-profiling-billing' ) ;
393
404
const otherOrganization = OrganizationFixture ( ) ;
394
405
renderComponent ( {
395
406
notificationType : 'quota' ,
@@ -403,13 +414,15 @@ describe('NotificationSettingsByType', function () {
403
414
expect ( screen . getByText ( 'Attachments' ) ) . toBeInTheDocument ( ) ;
404
415
expect ( screen . getByText ( 'Spend Allocations' ) ) . toBeInTheDocument ( ) ;
405
416
expect ( screen . getByText ( 'Transactions' ) ) . toBeInTheDocument ( ) ;
406
- expect ( screen . queryByText ( 'Continuous Profiling' ) ) . not . toBeInTheDocument ( ) ;
417
+ expect ( screen . queryByText ( 'Profile Hours' , { exact : true } ) ) . not . toBeInTheDocument ( ) ;
418
+ expect ( screen . queryByText ( 'UI Profile Hours' , { exact : true } ) ) . not . toBeInTheDocument ( ) ;
407
419
expect ( screen . queryByText ( 'Spans' ) ) . not . toBeInTheDocument ( ) ;
408
420
} ) ;
409
421
410
422
it ( 'spend notifications on org with am3 without spend visibility notifications' , async function ( ) {
411
- const organization = OrganizationFixture ( ) ;
412
- organization . features . push ( 'am3-tier' ) ;
423
+ const organization = OrganizationFixture ( {
424
+ features : [ 'am3-tier' , 'continuous-profiling-billing' ] ,
425
+ } ) ;
413
426
renderComponent ( {
414
427
notificationType : 'quota' ,
415
428
organizations : [ organization ] ,
@@ -423,7 +436,8 @@ describe('NotificationSettingsByType', function () {
423
436
expect ( screen . getByText ( 'Session Replays' ) ) . toBeInTheDocument ( ) ;
424
437
expect ( screen . getByText ( 'Attachments' ) ) . toBeInTheDocument ( ) ;
425
438
expect ( screen . getByText ( 'Spend Allocations' ) ) . toBeInTheDocument ( ) ;
426
- expect ( screen . queryByText ( 'Continuous Profiling' ) ) . not . toBeInTheDocument ( ) ; // TODO(Continuous Profiling GA): should be in document
439
+ expect ( screen . getByText ( 'Profile Hours' , { exact : true } ) ) . toBeInTheDocument ( ) ;
440
+ expect ( screen . getByText ( 'UI Profile Hours' , { exact : true } ) ) . toBeInTheDocument ( ) ;
427
441
expect ( screen . queryByText ( 'Transactions' ) ) . not . toBeInTheDocument ( ) ;
428
442
429
443
const editSettingMock = MockApiClient . addMockResponse ( {
@@ -454,4 +468,32 @@ describe('NotificationSettingsByType', function () {
454
468
} )
455
469
) ;
456
470
} ) ;
471
+
472
+ it ( 'should not show Profile Hours when continuous-profiling-billing is not enabled' , async function ( ) {
473
+ const organization = OrganizationFixture ( {
474
+ features : [
475
+ 'spend-visibility-notifications' ,
476
+ 'am3-tier' ,
477
+ // No continuous-profiling-billing feature
478
+ ] ,
479
+ } ) ;
480
+ renderComponent ( {
481
+ notificationType : 'quota' ,
482
+ organizations : [ organization ] ,
483
+ } ) ;
484
+
485
+ expect ( await screen . getAllByText ( 'Spend Notifications' ) . length ) . toBe ( 2 ) ;
486
+
487
+ // These should be present
488
+ expect ( screen . getByText ( 'Errors' ) ) . toBeInTheDocument ( ) ;
489
+ expect ( screen . getByText ( 'Spans' ) ) . toBeInTheDocument ( ) ;
490
+ expect ( screen . getByText ( 'Session Replays' ) ) . toBeInTheDocument ( ) ;
491
+ expect ( screen . getByText ( 'Attachments' ) ) . toBeInTheDocument ( ) ;
492
+ expect ( screen . getByText ( 'Spend Allocations' ) ) . toBeInTheDocument ( ) ;
493
+
494
+ // These should NOT be present
495
+ expect ( screen . queryByText ( 'Profile Hours' , { exact : true } ) ) . not . toBeInTheDocument ( ) ;
496
+ expect ( screen . queryByText ( 'UI Profile Hours' , { exact : true } ) ) . not . toBeInTheDocument ( ) ;
497
+ expect ( screen . queryByText ( 'Transactions' ) ) . not . toBeInTheDocument ( ) ;
498
+ } ) ;
457
499
} ) ;
0 commit comments