@@ -2,16 +2,10 @@ import moment from 'moment-timezone';
22import { OrganizationFixture } from 'sentry-fixture/organization' ;
33
44import { SubscriptionFixture } from 'getsentry-test/fixtures/subscription' ;
5- import {
6- renderGlobalModal ,
7- screen ,
8- userEvent ,
9- within ,
10- } from 'sentry-test/reactTestingLibrary' ;
5+ import { renderGlobalModal , screen , userEvent } from 'sentry-test/reactTestingLibrary' ;
116
127import { openAdminConfirmModal } from 'admin/components/adminConfirmationModal' ;
138import { TrialSubscriptionAction } from 'admin/components/trialSubscriptionAction' ;
14- import { PlanTier } from 'getsentry/types' ;
159
1610describe ( 'TrialSubscriptionAction' , ( ) => {
1711 const organization = OrganizationFixture ( ) ;
@@ -75,7 +69,6 @@ describe('TrialSubscriptionAction', () => {
7569 expect ( onConfirm ) . toHaveBeenCalledWith ( {
7670 trialDays : 45 ,
7771 startEnterpriseTrial : true ,
78- trialTier : PlanTier . AM3 ,
7972 } ) ;
8073 } ) ;
8174
@@ -219,87 +212,6 @@ describe('TrialSubscriptionAction', () => {
219212 ) ;
220213 } ) ;
221214
222- it ( 'displays am3 trial tier option when free plan' , async ( ) => {
223- jest . mock ( '@sentry/scraps/alert' ) ;
224-
225- openAdminConfirmModal ( {
226- onConfirm,
227- renderModalSpecificContent : deps => (
228- < TrialSubscriptionAction
229- subscription = { SubscriptionFixture ( {
230- organization,
231- plan : 'am2_f' ,
232- isFree : true ,
233- planTier : PlanTier . AM2 ,
234- } ) }
235- startEnterpriseTrial
236- { ...deps }
237- />
238- ) ,
239- } ) ;
240-
241- renderGlobalModal ( ) ;
242-
243- await userEvent . click ( screen . getByTestId ( 'trial-plan-tier-choices' ) ) ;
244- const trialTierInputs = within ( screen . getByRole ( 'dialog' ) ) . getAllByRole ( 'textbox' ) ;
245- await userEvent . click ( trialTierInputs [ 1 ] ! ) ;
246- expect ( screen . getByText ( 'am3' ) ) . toBeInTheDocument ( ) ;
247- } ) ;
248-
249- it ( 'displays am3 trial tier option when am3 plan' , async ( ) => {
250- jest . mock ( '@sentry/scraps/alert' ) ;
251-
252- openAdminConfirmModal ( {
253- onConfirm,
254- renderModalSpecificContent : deps => (
255- < TrialSubscriptionAction
256- subscription = { SubscriptionFixture ( {
257- organization,
258- plan : 'am3_team' ,
259- isFree : false ,
260- planTier : PlanTier . AM3 ,
261- } ) }
262- startEnterpriseTrial
263- { ...deps }
264- />
265- ) ,
266- } ) ;
267-
268- renderGlobalModal ( ) ;
269-
270- await userEvent . click ( screen . getByTestId ( 'trial-plan-tier-choices' ) ) ;
271- const trialTierInputs = within ( screen . getByRole ( 'dialog' ) ) . getAllByRole ( 'textbox' ) ;
272- await userEvent . click ( trialTierInputs [ 1 ] ! ) ;
273- expect ( screen . getByText ( 'am3' ) ) . toBeInTheDocument ( ) ;
274- } ) ;
275-
276- it ( 'displays am3 trial tier option when am2 plan' , async ( ) => {
277- jest . mock ( '@sentry/scraps/alert' ) ;
278-
279- openAdminConfirmModal ( {
280- onConfirm,
281- renderModalSpecificContent : deps => (
282- < TrialSubscriptionAction
283- subscription = { SubscriptionFixture ( {
284- organization,
285- plan : 'am2_team' ,
286- isFree : false ,
287- planTier : PlanTier . AM2 ,
288- } ) }
289- startEnterpriseTrial
290- { ...deps }
291- />
292- ) ,
293- } ) ;
294-
295- renderGlobalModal ( ) ;
296-
297- await userEvent . click ( screen . getByTestId ( 'trial-plan-tier-choices' ) ) ;
298- const trialTierInputs = within ( screen . getByRole ( 'dialog' ) ) . getAllByRole ( 'textbox' ) ;
299- await userEvent . click ( trialTierInputs [ 1 ] ! ) ;
300- expect ( screen . getByText ( 'am3' ) ) . toBeInTheDocument ( ) ;
301- } ) ;
302-
303215 it ( 'defaults 14-day trial for self-serve' , ( ) => {
304216 jest . mock ( '@sentry/scraps/alert' ) ;
305217
0 commit comments