@@ -82,16 +82,10 @@ vi.mock("../Announcement", () => ({
8282 } ,
8383} ) )
8484
85- // Mock RooCloudCTA component
86- vi . mock ( "@src/components/welcome/RooCloudCTA" , ( ) => ( {
87- default : function MockRooCloudCTA ( ) {
88- return (
89- < div data-testid = "roo-cloud-cta" >
90- < div > rooCloudCTA.title</ div >
91- < div > rooCloudCTA.description</ div >
92- < div > rooCloudCTA.joinWaitlist</ div >
93- </ div >
94- )
85+ // Mock DismissibleUpsell component
86+ vi . mock ( "@/components/common/DismissibleUpsell" , ( ) => ( {
87+ default : function MockDismissibleUpsell ( { children } : { children : React . ReactNode } ) {
88+ return < div data-testid = "dismissible-upsell" > { children } </ div >
9589 } ,
9690} ) )
9791
@@ -1274,10 +1268,10 @@ describe("ChatView - Version Indicator Tests", () => {
12741268 } )
12751269} )
12761270
1277- describe ( "ChatView - RooCloudCTA Display Tests" , ( ) => {
1271+ describe ( "ChatView - DismissibleUpsell Display Tests" , ( ) => {
12781272 beforeEach ( ( ) => vi . clearAllMocks ( ) )
12791273
1280- it ( "does not show RooCloudCTA when user is authenticated to Cloud" , ( ) => {
1274+ it ( "does not show DismissibleUpsell when user is authenticated to Cloud" , ( ) => {
12811275 const { queryByTestId } = renderChatView ( )
12821276
12831277 // Hydrate state with user authenticated to cloud
@@ -1292,11 +1286,11 @@ describe("ChatView - RooCloudCTA Display Tests", () => {
12921286 clineMessages : [ ] , // No active task
12931287 } )
12941288
1295- // Should not show RooCloudCTA when authenticated
1296- expect ( queryByTestId ( "roo-cloud-cta " ) ) . not . toBeInTheDocument ( )
1289+ // Should not show DismissibleUpsell when authenticated
1290+ expect ( queryByTestId ( "dismissible-upsell " ) ) . not . toBeInTheDocument ( )
12971291 } )
12981292
1299- it ( "does not show RooCloudCTA when user has only run 3 tasks in their history" , ( ) => {
1293+ it ( "does not show DismissibleUpsell when user has only run 3 tasks in their history" , ( ) => {
13001294 const { queryByTestId } = renderChatView ( )
13011295
13021296 // Hydrate state with user not authenticated but only 3 tasks
@@ -1310,11 +1304,11 @@ describe("ChatView - RooCloudCTA Display Tests", () => {
13101304 clineMessages : [ ] , // No active task
13111305 } )
13121306
1313- // Should not show RooCloudCTA with less than 4 tasks
1314- expect ( queryByTestId ( "roo-cloud-cta " ) ) . not . toBeInTheDocument ( )
1307+ // Should not show DismissibleUpsell with less than 4 tasks
1308+ expect ( queryByTestId ( "dismissible-upsell " ) ) . not . toBeInTheDocument ( )
13151309 } )
13161310
1317- it ( "shows RooCloudCTA when user is not authenticated and has run 4 or more tasks" , async ( ) => {
1311+ it ( "shows DismissibleUpsell when user is not authenticated and has run 4 or more tasks" , async ( ) => {
13181312 const { getByTestId } = renderChatView ( )
13191313
13201314 // Hydrate state with user not authenticated and 4 tasks
@@ -1329,13 +1323,13 @@ describe("ChatView - RooCloudCTA Display Tests", () => {
13291323 clineMessages : [ ] , // No active task
13301324 } )
13311325
1332- // Wait for component to render and show RooCloudCTA
1326+ // Wait for component to render and show DismissibleUpsell
13331327 await waitFor ( ( ) => {
1334- expect ( getByTestId ( "roo-cloud-cta " ) ) . toBeInTheDocument ( )
1328+ expect ( getByTestId ( "dismissible-upsell " ) ) . toBeInTheDocument ( )
13351329 } )
13361330 } )
13371331
1338- it ( "shows RooCloudCTA when user is not authenticated and has run 5 tasks" , async ( ) => {
1332+ it ( "shows DismissibleUpsell when user is not authenticated and has run 5 tasks" , async ( ) => {
13391333 const { getByTestId } = renderChatView ( )
13401334
13411335 // Hydrate state with user not authenticated and 5 tasks
@@ -1351,13 +1345,13 @@ describe("ChatView - RooCloudCTA Display Tests", () => {
13511345 clineMessages : [ ] , // No active task
13521346 } )
13531347
1354- // Wait for component to render and show RooCloudCTA
1348+ // Wait for component to render and show DismissibleUpsell
13551349 await waitFor ( ( ) => {
1356- expect ( getByTestId ( "roo-cloud-cta " ) ) . toBeInTheDocument ( )
1350+ expect ( getByTestId ( "dismissible-upsell " ) ) . toBeInTheDocument ( )
13571351 } )
13581352 } )
13591353
1360- it ( "does not show RooCloudCTA when there is an active task (regardless of auth status)" , async ( ) => {
1354+ it ( "does not show DismissibleUpsell when there is an active task (regardless of auth status)" , async ( ) => {
13611355 const { queryByTestId } = renderChatView ( )
13621356
13631357 // Hydrate state with active task
@@ -1381,16 +1375,16 @@ describe("ChatView - RooCloudCTA Display Tests", () => {
13811375
13821376 // Wait for component to render with active task
13831377 await waitFor ( ( ) => {
1384- // Should not show RooCloudCTA during active task
1385- expect ( queryByTestId ( "roo-cloud-cta " ) ) . not . toBeInTheDocument ( )
1378+ // Should not show DismissibleUpsell during active task
1379+ expect ( queryByTestId ( "dismissible-upsell " ) ) . not . toBeInTheDocument ( )
13861380 // Should not show RooTips either since the entire welcome screen is hidden during active tasks
13871381 expect ( queryByTestId ( "roo-tips" ) ) . not . toBeInTheDocument ( )
13881382 // Should not show RooHero either since the entire welcome screen is hidden during active tasks
13891383 expect ( queryByTestId ( "roo-hero" ) ) . not . toBeInTheDocument ( )
13901384 } )
13911385 } )
13921386
1393- it ( "shows RooTips when user is authenticated (instead of RooCloudCTA )" , ( ) => {
1387+ it ( "shows RooTips when user is authenticated (instead of DismissibleUpsell )" , ( ) => {
13941388 const { queryByTestId, getByTestId } = renderChatView ( )
13951389
13961390 // Hydrate state with user authenticated to cloud
@@ -1405,12 +1399,12 @@ describe("ChatView - RooCloudCTA Display Tests", () => {
14051399 clineMessages : [ ] , // No active task
14061400 } )
14071401
1408- // Should not show RooCloudCTA but should show RooTips
1409- expect ( queryByTestId ( "roo-cloud-cta " ) ) . not . toBeInTheDocument ( )
1402+ // Should not show DismissibleUpsell but should show RooTips
1403+ expect ( queryByTestId ( "dismissible-upsell " ) ) . not . toBeInTheDocument ( )
14101404 expect ( getByTestId ( "roo-tips" ) ) . toBeInTheDocument ( )
14111405 } )
14121406
1413- it ( "shows RooTips when user has fewer than 4 tasks (instead of RooCloudCTA )" , ( ) => {
1407+ it ( "shows RooTips when user has fewer than 4 tasks (instead of DismissibleUpsell )" , ( ) => {
14141408 const { queryByTestId, getByTestId } = renderChatView ( )
14151409
14161410 // Hydrate state with user not authenticated but fewer than 4 tasks
@@ -1424,8 +1418,8 @@ describe("ChatView - RooCloudCTA Display Tests", () => {
14241418 clineMessages : [ ] , // No active task
14251419 } )
14261420
1427- // Should not show RooCloudCTA but should show RooTips
1428- expect ( queryByTestId ( "roo-cloud-cta " ) ) . not . toBeInTheDocument ( )
1421+ // Should not show DismissibleUpsell but should show RooTips
1422+ expect ( queryByTestId ( "dismissible-upsell " ) ) . not . toBeInTheDocument ( )
14291423 expect ( getByTestId ( "roo-tips" ) ) . toBeInTheDocument ( )
14301424 } )
14311425} )
0 commit comments