@@ -11,6 +11,7 @@ import {
11
11
screen ,
12
12
userEvent ,
13
13
waitFor ,
14
+ within ,
14
15
} from 'sentry-test/reactTestingLibrary' ;
15
16
import selectEvent from 'sentry-test/selectEvent' ;
16
17
@@ -60,11 +61,22 @@ describe('ChangePlanAction', () => {
60
61
{ events : 25000 , price : 5000 } ,
61
62
] ,
62
63
} ,
63
- userSelectable : true ,
64
+ userSelectable : false ,
65
+ isTestPlan : true ,
66
+ } ) ;
67
+
68
+ const freeTestPlan = PlanFixture ( {
69
+ id : 'free_test_monthly' ,
70
+ name : 'TEST Tier Free Test Plan' ,
71
+ price : 0 ,
72
+ basePrice : 0 ,
73
+ billingInterval : 'monthly' ,
74
+ userSelectable : false ,
64
75
isTestPlan : true ,
65
76
} ) ;
66
77
67
78
BILLING_CONFIG . planList . push ( testPlan ) ;
79
+ BILLING_CONFIG . planList . push ( freeTestPlan ) ;
68
80
69
81
beforeEach ( ( ) => {
70
82
jest . clearAllMocks ( ) ;
@@ -308,10 +320,15 @@ describe('ChangePlanAction', () => {
308
320
const testTierTab = screen . getByRole ( 'tab' , { name : 'TEST' } ) ;
309
321
await userEvent . click ( testTierTab ) ;
310
322
311
- // Verify TEST tier plans are shown after clicking the TEST tier tab
323
+ // Verify >$0 TEST tier plans are shown after clicking the TEST tier tab
312
324
await waitFor ( ( ) => {
313
- const testPlans = screen . queryAllByTestId ( 'change-plan-label-test_test_monthly' ) ;
314
- expect ( testPlans . length ) . toBeGreaterThan ( 0 ) ;
325
+ const testPlans = screen . queryAllByTestId ( / _ t e s t _ m o n t h l y / ) ;
326
+ expect ( testPlans ) . toHaveLength ( 1 ) ;
327
+
328
+ testPlans . forEach ( planLabel => {
329
+ expect ( within ( planLabel ) . getByText ( '$50 / monthly' ) ) . toBeInTheDocument ( ) ;
330
+ expect ( within ( planLabel ) . queryByText ( '$0 / monthly' ) ) . not . toBeInTheDocument ( ) ;
331
+ } ) ;
315
332
} ) ;
316
333
} ) ;
317
334
0 commit comments