Skip to content

Commit 6ce9ce5

Browse files
committed
Test fixes
1 parent a255a14 commit 6ce9ce5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

webview-ui/src/components/cloud/CloudAgents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const CloudAgents: React.FC = () => {
7676
<button
7777
onClick={handleCreateClick}
7878
className="text-base flex items-center gap-1 text-vscode-descriptionForeground hover:text-vscode-textLink-foreground transition-colors cursor-pointer"
79-
title={t("chat:cloudAgents.createNew")}>
79+
title={t("chat:cloudAgents.create")}>
8080
<Plus className="h-4 w-4" />
8181
{t("chat:cloudAgents.create")}
8282
</button>

webview-ui/src/components/cloud/__tests__/CloudAgents.spec.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe("CloudAgents", () => {
8282

8383
// Wait for the component to render agents
8484
await waitFor(() => {
85-
expect(screen.getByText("Cloud Agents")).toBeInTheDocument()
85+
expect(screen.getByText("chat:cloudAgents.title")).toBeInTheDocument()
8686
expect(screen.getByText("Code Assistant")).toBeInTheDocument()
8787
expect(screen.getByText("Test Agent")).toBeInTheDocument()
8888
})
@@ -120,10 +120,12 @@ describe("CloudAgents", () => {
120120
})
121121

122122
await waitFor(() => {
123-
expect(screen.getByText("Cloud Agents")).toBeInTheDocument()
123+
expect(screen.getByText("chat:cloudAgents.title")).toBeInTheDocument()
124+
expect(screen.getByText("Code Assistant")).toBeInTheDocument()
125+
expect(screen.getByText("Test Agent")).toBeInTheDocument()
124126
})
125127

126-
const createButton = screen.getByTitle("Create new agent")
128+
const createButton = screen.getByTitle("chat:cloudAgents.create")
127129
fireEvent.click(createButton)
128130

129131
expect(mockPostMessage).toHaveBeenCalledWith({
@@ -142,11 +144,11 @@ describe("CloudAgents", () => {
142144
})
143145

144146
await waitFor(() => {
145-
expect(screen.getByText(/any Cloud Agents yet/)).toBeInTheDocument()
147+
expect(screen.getByText("chat:cloudAgents.createFirst")).toBeInTheDocument()
146148
})
147149

148150
// Find and click the "Create your first" button in the empty state
149-
const createFirstButton = screen.getByText("Create your first.")
151+
const createFirstButton = screen.getByText("chat:cloudAgents.createFirst")
150152
fireEvent.click(createFirstButton)
151153

152154
expect(mockPostMessage).toHaveBeenCalledWith({
@@ -168,7 +170,7 @@ describe("CloudAgents", () => {
168170
// Wait for the component to process the error
169171
await waitFor(() => {
170172
// Component should render nothing on error
171-
expect(screen.queryByText("Cloud Agents")).not.toBeInTheDocument()
173+
expect(screen.queryByText("chat:cloudAgents.title")).not.toBeInTheDocument()
172174
})
173175
})
174176

0 commit comments

Comments
 (0)