fmt(js): npm run fix on merge (#69562)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
hermes-seaeye[bot] 2026-07-22 19:01:09 +00:00 committed by GitHub
parent bb24364f25
commit 0ec4a873c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 6 deletions

View file

@ -130,7 +130,11 @@ describe('usePreviewRouting', () => {
)
act(() =>
handleEvent({ payload: { url: 'https://www.cnn.com', label: 'CNN' }, session_id: 'session-1', type: 'preview.open' })
handleEvent({
payload: { url: 'https://www.cnn.com', label: 'CNN' },
session_id: 'session-1',
type: 'preview.open'
})
)
await waitFor(() => {

View file

@ -116,7 +116,10 @@ export function usePreviewRouting({
void normalizeOrLocalPreviewTarget(target, $currentCwd.get() || currentCwd || undefined).then(resolved => {
if (resolved) {
const trimmedLabel = typeof label === 'string' ? label.trim() : ''
setCurrentSessionPreviewTarget(trimmedLabel ? { ...resolved, label: trimmedLabel } : resolved, 'tool-result')
setCurrentSessionPreviewTarget(
trimmedLabel ? { ...resolved, label: trimmedLabel } : resolved,
'tool-result'
)
}
})
}

View file

@ -31,9 +31,9 @@ describe('JsonRpcGatewayClient connect() URL guard', () => {
it('rejects a non-string IPC result object', async () => {
const client = new JsonRpcGatewayClient()
await expect(
client.connect({ ok: true, wsUrl: 'ws://127.0.0.1:1/api/ws' } as unknown as string)
).rejects.toThrow(/requires a ws:\/\/ or wss:\/\/ URL string, got type "object"/)
await expect(client.connect({ ok: true, wsUrl: 'ws://127.0.0.1:1/api/ws' } as unknown as string)).rejects.toThrow(
/requires a ws:\/\/ or wss:\/\/ URL string, got type "object"/
)
})
it('rejects a non-ws URL string', async () => {

View file

@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import { DAY, HOUR, MINUTE, SECOND, formatAgo } from './time'
import { DAY, formatAgo, HOUR, MINUTE, SECOND } from './time'
const labels = {
ageNow: 'now',

View file

@ -108,6 +108,7 @@ export class JsonRpcGatewayClient {
}
let url: URL
try {
url = new URL(wsUrl)
} catch {