Skip to content

Commit 92e7117

Browse files
committed
test: add token count to ActiveWorkspaceWithChat story
Pre-fills input text and model so the token count display is visible, capturing the text-[11px] fix for visual regression testing.
1 parent 1c8c63e commit 92e7117

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/browser/App.stories.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,18 @@ export const ActiveWorkspaceWithChat: Story = {
541541
projects,
542542
workspaces,
543543
apiOverrides: {
544+
tokenizer: {
545+
countTokens: () => Promise.resolve(42),
546+
countTokensBatch: (_model, texts) => Promise.resolve(texts.map(() => 42)),
547+
calculateStats: () =>
548+
Promise.resolve({
549+
consumers: [],
550+
totalTokens: 0,
551+
model: "mock-model",
552+
tokenizerName: "mock-tokenizer",
553+
usageHistory: [],
554+
}),
555+
},
544556
providers: {
545557
setProviderConfig: () => Promise.resolve({ success: true, data: undefined }),
546558
list: () => Promise.resolve(["anthropic", "openai", "xai"]),
@@ -1246,6 +1258,13 @@ main
12461258
})
12471259
);
12481260

1261+
// Pre-fill input with text so token count is visible
1262+
localStorage.setItem(
1263+
`input:${workspaceId}`,
1264+
"Add OAuth2 support with Google and GitHub providers"
1265+
);
1266+
localStorage.setItem(`model:${workspaceId}`, "anthropic:claude-sonnet-4-5");
1267+
12491268
initialized.current = true;
12501269
}
12511270

0 commit comments

Comments
 (0)