Skip to content

Commit d05fff3

Browse files
committed
test: should show free branding for user without pro subscription (expired trial)
1 parent 53fbd8c commit d05fff3

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

test/spec/login-browser-integ-test.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,51 @@ define(function (require, exports, module) {
529529
await popupToAppear(SIGNIN_POPUP);
530530
await verifyProfilePopupContent(VIEW_TRIAL_DAYS_LEFT,
531531
"trial user profile popup for logged out user");
532+
533+
// Close popup
534+
$profileButton.trigger('click');
535+
});
536+
537+
it("should show free branding for user without pro subscription (expired trial)", async function () {
538+
console.log("llgT: Starting desktop trial user test");
539+
540+
// Setup: No pro subscription + active trial (15 days)
541+
setupProUserMock(false);
542+
await setupExpiredTrial();
543+
544+
// Verify initial state (no pro branding)
545+
await verifyProBranding(false, "no pro branding to start with");
546+
547+
// Perform login
548+
await performFullLoginFlow();
549+
550+
// Verify pro branding remains after login
551+
await verifyProBranding(false, "after trial free user login");
552+
553+
// Check profile popup shows free plan status
554+
const $profileButton = testWindow.$("#user-profile-button");
555+
$profileButton.trigger('click');
556+
await popupToAppear(PROFILE_POPUP);
557+
await verifyProfilePopupContent(VIEW_PHOENIX_FREE,
558+
"free plan user profile popup for logged in user");
559+
560+
// Close popup
561+
$profileButton.trigger('click');
562+
563+
// Perform logout
564+
await performFullLogoutFlow();
565+
566+
// Verify pro branding remains after logout (trial continues)
567+
await verifyProBranding(false, "Trial branding to remain after logout");
568+
569+
// Check profile popup still shows free plan status as trial expired
570+
$profileButton.trigger('click');
571+
await popupToAppear(SIGNIN_POPUP);
572+
// not logged in user, we wont show free plan tag as base editor is always free.
573+
expect(testWindow.$(`.profile-popup .trial-plan-info`).length).toBe(0);
574+
575+
// Close popup
576+
$profileButton.trigger('click');
532577
});
533578
});
534579
});

test/spec/login-desktop-integ-test.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,51 @@ define(function (require, exports, module) {
602602
await popupToAppear(SIGNIN_POPUP);
603603
await verifyProfilePopupContent(VIEW_TRIAL_DAYS_LEFT,
604604
"trial user profile popup for logged out user");
605+
606+
// Close popup
607+
$profileButton.trigger('click');
608+
});
609+
610+
it("should show free branding for user without pro subscription (expired trial)", async function () {
611+
console.log("llgT: Starting desktop trial user test");
612+
613+
// Setup: No pro subscription + active trial (15 days)
614+
setupProUserMock(false);
615+
await setupExpiredTrial();
616+
617+
// Verify initial state (no pro branding)
618+
await verifyProBranding(false, "no pro branding to start with");
619+
620+
// Perform login
621+
await performFullLoginFlow();
622+
623+
// Verify pro branding remains after login
624+
await verifyProBranding(false, "after trial free user login");
625+
626+
// Check profile popup shows free plan status
627+
const $profileButton = testWindow.$("#user-profile-button");
628+
$profileButton.trigger('click');
629+
await popupToAppear(PROFILE_POPUP);
630+
await verifyProfilePopupContent(VIEW_PHOENIX_FREE,
631+
"free plan user profile popup for logged in user");
632+
633+
// Close popup
634+
$profileButton.trigger('click');
635+
636+
// Perform logout
637+
await performFullLogoutFlow();
638+
639+
// Verify pro branding remains after logout (trial continues)
640+
await verifyProBranding(false, "Trial branding to remain after logout");
641+
642+
// Check profile popup still shows free plan status as trial expired
643+
$profileButton.trigger('click');
644+
await popupToAppear(SIGNIN_POPUP);
645+
// not logged in user, we wont show free plan tag as base editor is always free.
646+
expect(testWindow.$(`.profile-popup .trial-plan-info`).length).toBe(0);
647+
648+
// Close popup
649+
$profileButton.trigger('click');
605650
});
606651
});
607652
});

0 commit comments

Comments
 (0)