Skip to content

Commit 7d10582

Browse files
committed
adding more steps
1 parent d1ff833 commit 7d10582

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

integration/tests/pricing-table.test.ts

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,45 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withBilling] })('pricing tabl
297297
// Verify the user is now shown as having an active free trial
298298
// The pricing table should show their current plan as active
299299
await u.po.pricingTable.waitToBeActive({ planSlug: 'trial' });
300-
// Verify trial end date is displayed
300+
301+
await u.po.page.goToRelative('/user');
302+
await u.po.userProfile.waitForMounted();
303+
await u.po.userProfile.switchToBillingTab();
304+
305+
await expect(
306+
u.po.page
307+
.locator('.cl-profileSectionContent__subscriptionsList')
308+
.getByText(/Trial/i)
309+
.locator('xpath=..')
310+
.getByText(/Free trial/i),
311+
).toBeVisible();
312+
301313
await expect(u.po.page.getByText(/Trial ends/i)).toBeVisible();
314+
315+
await u.po.page.getByRole('button', { name: 'Manage subscription' }).first().click();
316+
await u.po.subscriptionDetails.waitForMounted();
317+
await u.po.subscriptionDetails.root.locator('.cl-menuButtonEllipsisBordered').click();
318+
await u.po.subscriptionDetails.root.getByText('Cancel free trial').click();
319+
await u.po.subscriptionDetails.root.locator('.cl-drawerConfirmationRoot').waitFor({ state: 'visible' });
320+
await u.po.subscriptionDetails.root.getByRole('button', { name: 'Cancel free trial' }).click();
321+
await u.po.subscriptionDetails.waitForUnmounted();
322+
323+
await expect(
324+
u.po.page
325+
.locator('.cl-profileSectionContent__subscriptionsList')
326+
.getByText(/Trial/i)
327+
.locator('xpath=..')
328+
.getByText(/Free trial/i),
329+
).toBeVisible();
330+
331+
// Verify the Free plan with Upcoming status exists
332+
await expect(
333+
u.po.page
334+
.locator('.cl-profileSectionContent__subscriptionsList')
335+
.getByText('Free')
336+
.locator('xpath=..')
337+
.getByText('Upcoming'),
338+
).toBeVisible();
302339
} finally {
303340
// Clean up the trial user
304341
await trialUser.deleteIfExists();

0 commit comments

Comments
 (0)