Skip to content

Commit b321b43

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 b321b43

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/browser/App.stories.tsx

Lines changed: 16 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,10 @@ main
12461258
})
12471259
);
12481260

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

0 commit comments

Comments
 (0)