Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 0988ec1

Browse files
committed
Update ChatView welcome tests after cloud removal
1 parent 2cc16bd commit 0988ec1

1 file changed

Lines changed: 12 additions & 30 deletions

File tree

webview-ui/src/components/chat/__tests__/ChatView.spec.tsx

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -662,15 +662,13 @@ describe("ChatView - Version Indicator Tests", () => {
662662
})
663663
})
664664

665-
describe("ChatView - DismissibleUpsell Display Tests", () => {
665+
describe("ChatView - Welcome Content Display Tests", () => {
666666
beforeEach(() => vi.clearAllMocks())
667667

668-
it("does not show DismissibleUpsell when user is authenticated to Cloud", () => {
668+
it("does not show removed cloud upsell for returning users", () => {
669669
const { queryByTestId } = renderChatView()
670670

671-
// Hydrate state with user authenticated to cloud
672671
mockPostMessage({
673-
cloudIsAuthenticated: true,
674672
taskHistory: [
675673
{ id: "1", ts: Date.now() - 3000 },
676674
{ id: "2", ts: Date.now() - 2000 },
@@ -680,16 +678,13 @@ describe("ChatView - DismissibleUpsell Display Tests", () => {
680678
clineMessages: [], // No active task
681679
})
682680

683-
// Should not show DismissibleUpsell when authenticated
684681
expect(queryByTestId("dismissible-upsell")).not.toBeInTheDocument()
685682
})
686683

687-
it("does not show DismissibleUpsell when user has only run 3 tasks in their history", () => {
684+
it("shows RooTips when user has only run 3 tasks in their history", () => {
688685
const { queryByTestId } = renderChatView()
689686

690-
// Hydrate state with user not authenticated but only 3 tasks
691687
mockPostMessage({
692-
cloudIsAuthenticated: false,
693688
taskHistory: [
694689
{ id: "1", ts: Date.now() - 2000 },
695690
{ id: "2", ts: Date.now() - 1000 },
@@ -698,16 +693,14 @@ describe("ChatView - DismissibleUpsell Display Tests", () => {
698693
clineMessages: [], // No active task
699694
})
700695

701-
// Should not show DismissibleUpsell with less than 4 tasks
702696
expect(queryByTestId("dismissible-upsell")).not.toBeInTheDocument()
697+
expect(queryByTestId("roo-tips")).toBeInTheDocument()
703698
})
704699

705-
it("shows DismissibleUpsell when user is not authenticated and has run 6 or more tasks", async () => {
706-
const { getByTestId } = renderChatView()
700+
it("does not show removed cloud upsell when user has run 6 or more tasks", async () => {
701+
const { queryByTestId } = renderChatView()
707702

708-
// Hydrate state with user not authenticated and 4 tasks
709703
mockPostMessage({
710-
cloudIsAuthenticated: false,
711704
taskHistory: [
712705
{ id: "1", ts: Date.now() - 6000 },
713706
{ id: "2", ts: Date.now() - 5000 },
@@ -720,18 +713,17 @@ describe("ChatView - DismissibleUpsell Display Tests", () => {
720713
clineMessages: [], // No active task
721714
})
722715

723-
// Wait for component to render and show DismissibleUpsell
724716
await waitFor(() => {
725-
expect(getByTestId("dismissible-upsell")).toBeInTheDocument()
717+
expect(queryByTestId("dismissible-upsell")).not.toBeInTheDocument()
718+
expect(queryByTestId("roo-tips")).not.toBeInTheDocument()
719+
expect(queryByTestId("roo-hero")).toBeInTheDocument()
726720
})
727721
})
728722

729-
it("does not show DismissibleUpsell when there is an active task (regardless of auth status)", async () => {
723+
it("does not show welcome content when there is an active task", async () => {
730724
const { queryByTestId } = renderChatView()
731725

732-
// Hydrate state with active task
733726
mockPostMessage({
734-
cloudIsAuthenticated: false,
735727
taskHistory: [
736728
{ id: "1", ts: Date.now() - 3000 },
737729
{ id: "2", ts: Date.now() - 2000 },
@@ -748,23 +740,17 @@ describe("ChatView - DismissibleUpsell Display Tests", () => {
748740
],
749741
})
750742

751-
// Wait for component to render with active task
752743
await waitFor(() => {
753-
// Should not show DismissibleUpsell during active task
754744
expect(queryByTestId("dismissible-upsell")).not.toBeInTheDocument()
755-
// Should not show RooTips either since the entire welcome screen is hidden during active tasks
756745
expect(queryByTestId("roo-tips")).not.toBeInTheDocument()
757-
// Should not show RooHero either since the entire welcome screen is hidden during active tasks
758746
expect(queryByTestId("roo-hero")).not.toBeInTheDocument()
759747
})
760748
})
761749

762-
it("shows RooTips when user is authenticated (instead of DismissibleUpsell)", () => {
750+
it("shows RooTips for newer users", () => {
763751
const { queryByTestId, getByTestId } = renderChatView()
764752

765-
// Hydrate state with user authenticated to cloud
766753
mockPostMessage({
767-
cloudIsAuthenticated: true,
768754
taskHistory: [
769755
{ id: "1", ts: Date.now() - 3000 },
770756
{ id: "2", ts: Date.now() - 2000 },
@@ -774,17 +760,14 @@ describe("ChatView - DismissibleUpsell Display Tests", () => {
774760
clineMessages: [], // No active task
775761
})
776762

777-
// Should not show DismissibleUpsell but should show RooTips
778763
expect(queryByTestId("dismissible-upsell")).not.toBeInTheDocument()
779764
expect(getByTestId("roo-tips")).toBeInTheDocument()
780765
})
781766

782-
it("shows RooTips when user has fewer than 6 tasks (instead of DismissibleUpsell)", () => {
767+
it("shows RooTips when user has fewer than 6 tasks", () => {
783768
const { queryByTestId, getByTestId } = renderChatView()
784769

785-
// Hydrate state with user not authenticated but fewer than 4 tasks
786770
mockPostMessage({
787-
cloudIsAuthenticated: false,
788771
taskHistory: [
789772
{ id: "1", ts: Date.now() - 2000 },
790773
{ id: "2", ts: Date.now() - 1000 },
@@ -793,7 +776,6 @@ describe("ChatView - DismissibleUpsell Display Tests", () => {
793776
clineMessages: [], // No active task
794777
})
795778

796-
// Should not show DismissibleUpsell but should show RooTips
797779
expect(queryByTestId("dismissible-upsell")).not.toBeInTheDocument()
798780
expect(getByTestId("roo-tips")).toBeInTheDocument()
799781
})

0 commit comments

Comments
 (0)