Skip to content

Commit 53c677c

Browse files
test(webview): use shared state fixture in chat tests
Align the rebased aggregated-cost task-state helper with the shared extension-state factory and provide the required history item fields. Signed-off-by: JunyongParkDev <[email protected]>
1 parent f7fde69 commit 53c677c

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,7 @@ const dispatchExtensionMessage = async (data: Record<string, unknown>) => {
367367
const dispatchTaskState = async (id: string, taskTs: number, childIds: string[] = []) => {
368368
await dispatchExtensionMessage({
369369
type: "state",
370-
state: {
371-
version: "1.0.0",
370+
state: makeExtensionState({
372371
clineMessages: [
373372
{
374373
type: "say",
@@ -380,17 +379,15 @@ const dispatchTaskState = async (id: string, taskTs: number, childIds: string[]
380379
currentTaskId: id,
381380
currentTaskItem: {
382381
id,
382+
number: 1,
383383
ts: taskTs,
384384
task: id,
385+
tokensIn: 0,
386+
tokensOut: 0,
387+
totalCost: 0,
385388
childIds,
386389
},
387-
taskHistory: [],
388-
shouldShowAnnouncement: false,
389-
allowedCommands: [],
390-
alwaysAllowExecute: false,
391-
cloudIsAuthenticated: false,
392-
telemetrySetting: "enabled",
393-
},
390+
}),
394391
})
395392
}
396393

0 commit comments

Comments
 (0)