@@ -306,8 +306,6 @@ define(function (require, exports, module) {
306306 await cleanupTrialState ( ) ;
307307 } ) ;
308308
309- LoginShared . setupSharedTests ( ) ;
310-
311309 it ( "should open browser and copy validation code" , async function ( ) {
312310 // Setup basic user mock
313311 setupProUserMock ( false ) ;
@@ -352,162 +350,7 @@ define(function (require, exports, module) {
352350 expect ( capturedBrowserURL ) . toContain ( 'test-session-123' ) ;
353351 } ) ;
354352
355- it ( "should show pro branding for user with pro subscription (expired trial)" , async function ( ) {
356- console . log ( "llgT: Starting desktop pro user with expired trial test" ) ;
357-
358- // Setup: Pro subscription + expired trial
359- setupProUserMock ( true ) ;
360- await setupExpiredTrial ( ) ;
361-
362- // Verify initial state (no pro branding)
363- await verifyProBranding ( false , "no pro branding to start with" ) ;
364-
365- // Perform login
366- await performFullLoginFlow ( ) ;
367- await verifyProBranding ( true , "pro branding to appear after pro user login" ) ;
368-
369- // Check profile popup shows pro status (not trial)
370- const $profileButton = testWindow . $ ( "#user-profile-button" ) ;
371- $profileButton . trigger ( 'click' ) ;
372-
373- // Wait for profile popup to show "phoenix pro <leaf>"
374- await verifyProfilePopupContent ( VIEW_PHOENIX_PRO , "pro user profile popup" ) ;
375-
376- // Close popup
377- $profileButton . trigger ( 'click' ) ;
378-
379- // Perform logout
380- await performFullLogoutFlow ( ) ;
381-
382- // For user with pro subscription + expired trial:
383- // After logout, pro branding should disappear because:
384- // 1. No server entitlements (logged out)
385- // 2. Trial is expired (0 days remaining)
386- await verifyProBranding ( false , "Pro branding to disappear after logout" ) ;
387- } ) ;
388-
389- it ( "should show trial branding for user without pro subscription (active trial)" , async function ( ) {
390- console . log ( "llgT: Starting desktop trial user test" ) ;
391-
392- // Setup: No pro subscription + active trial (15 days)
393- setupProUserMock ( false ) ;
394- await setupTrialState ( 15 ) ;
395-
396- // Verify initial state shows pro branding due to trial
397- await verifyProBranding ( true , "Trial branding to appear initially" ) ;
398-
399- // Perform login
400- await performFullLoginFlow ( ) ;
401-
402- // Verify pro branding remains after login
403- await verifyProBranding ( true , "after trial user login" ) ;
404-
405- // Check profile popup shows trial status
406- const $profileButton = testWindow . $ ( "#user-profile-button" ) ;
407- $profileButton . trigger ( 'click' ) ;
408- await popupToAppear ( PROFILE_POPUP ) ;
409- await verifyProfilePopupContent ( VIEW_TRIAL_DAYS_LEFT ,
410- "trial user profile popup for logged in user" ) ;
411-
412- // Close popup
413- $profileButton . trigger ( 'click' ) ;
414-
415- // Perform logout
416- await performFullLogoutFlow ( ) ;
417-
418- // Verify pro branding remains after logout (trial continues)
419- await verifyProBranding ( true , "Trial branding to remain after logout" ) ;
420-
421- // Check profile popup still shows trial status
422- $profileButton . trigger ( 'click' ) ;
423- await popupToAppear ( SIGNIN_POPUP ) ;
424- await verifyProfilePopupContent ( VIEW_TRIAL_DAYS_LEFT ,
425- "trial user profile popup for logged out user" ) ;
426-
427- // Close popup
428- $profileButton . trigger ( 'click' ) ;
429- } ) ;
430-
431- it ( "should prioritize pro subscription over trial in profile popup" , async function ( ) {
432- console . log ( "llgT: Starting desktop trial user with pro subscription test" ) ;
433-
434- // Setup: Pro subscription + active trial
435- setupProUserMock ( true ) ;
436- await setupTrialState ( 10 ) ;
437-
438- // Perform login
439- await performFullLoginFlow ( ) ;
440-
441- // Verify pro branding appears
442- await verifyProBranding ( true , "Pro branding to appear for pro user" ) ;
443-
444- // Check profile popup shows pro status (not trial text)
445- const $profileButton = testWindow . $ ( "#user-profile-button" ) ;
446- $profileButton . trigger ( 'click' ) ;
447- await popupToAppear ( PROFILE_POPUP ) ;
448-
449- // Should show pro, not trial, since user has paid subscription
450- await verifyProfilePopupContent ( VIEW_PHOENIX_PRO ,
451- "pro+trial user profile should not show trial branding" ) ;
452-
453- // Close popup
454- $profileButton . trigger ( 'click' ) ;
455-
456- // Perform logout
457- await performFullLogoutFlow ( ) ;
458-
459- // Verify pro branding remains due to trial (even though subscription is gone)
460- await verifyProBranding ( true , "Pro branding should remain after logout as trial user" ) ;
461- $profileButton . trigger ( 'click' ) ;
462- await popupToAppear ( SIGNIN_POPUP ) ;
463- await verifyProfilePopupContent ( VIEW_TRIAL_DAYS_LEFT ,
464- "trial user profile popup for logged out user" ) ;
465-
466- // Close popup
467- $profileButton . trigger ( 'click' ) ;
468- } ) ;
469-
470- it ( "should show free branding for user without pro subscription (expired trial)" , async function ( ) {
471- console . log ( "llgT: Starting desktop trial user test" ) ;
472-
473- // Setup: No pro subscription + active trial (15 days)
474- setupProUserMock ( false ) ;
475- await setupExpiredTrial ( ) ;
476-
477- // Verify initial state (no pro branding)
478- await verifyProBranding ( false , "no pro branding to start with" ) ;
479-
480- // Perform login
481- await performFullLoginFlow ( ) ;
482-
483- // Verify pro branding remains after login
484- await verifyProBranding ( false , "after trial free user login" ) ;
485-
486- // Check profile popup shows free plan status
487- const $profileButton = testWindow . $ ( "#user-profile-button" ) ;
488- $profileButton . trigger ( 'click' ) ;
489- await popupToAppear ( PROFILE_POPUP ) ;
490- await verifyProfilePopupContent ( VIEW_PHOENIX_FREE ,
491- "free plan user profile popup for logged in user" ) ;
492-
493- // Close popup
494- $profileButton . trigger ( 'click' ) ;
495-
496- // Perform logout
497- await performFullLogoutFlow ( ) ;
498-
499- // Verify pro branding remains after logout (trial continues)
500- await verifyProBranding ( false , "Trial branding to remain after logout" ) ;
501-
502- // Check profile popup still shows free plan status as trial expired
503- $profileButton . trigger ( 'click' ) ;
504- await popupToAppear ( SIGNIN_POPUP ) ;
505- // not logged in user, we wont show free plan tag as base editor is always free.
506- expect ( testWindow . $ ( `.profile-popup .trial-plan-info` ) . length ) . toBe ( 0 ) ;
507-
508- // Close popup
509- $profileButton . trigger ( 'click' ) ;
510- } ) ;
353+ LoginShared . setupSharedTests ( ) ;
511354 } ) ;
512355 } ) ;
513356} ) ;
0 commit comments