@@ -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 ( / T r i a l / i)
309+ . locator ( 'xpath=..' )
310+ . getByText ( / F r e e t r i a l / i) ,
311+ ) . toBeVisible ( ) ;
312+
301313 await expect ( u . po . page . getByText ( / T r i a l e n d s / 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 ( / T r i a l / i)
327+ . locator ( 'xpath=..' )
328+ . getByText ( / F r e e t r i a l / 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