|
@@ -57,7 +57,7 @@ it.each([undefined, null, { agents: [], conversations: [], details: [] }])('reco
|
|
|
expect(wrapper!.get('[role="alert"]').text()).toContain('Bot 会话数据尚未就绪')
|
|
expect(wrapper!.get('[role="alert"]').text()).toContain('Bot 会话数据尚未就绪')
|
|
|
expect(wrapper!.text()).not.toContain('TypeError')
|
|
expect(wrapper!.text()).not.toContain('TypeError')
|
|
|
await vi.advanceTimersByTimeAsync(1500); await flushPromises()
|
|
await vi.advanceTimersByTimeAsync(1500); await flushPromises()
|
|
|
- expect(sources.map(source => source.url)).toEqual(['/api/app/events/stream?after=17'])
|
|
|
|
|
|
|
+ expect(sources.map(source => source.url)).toEqual(['/api/app/events/stream?after=17&toolDetails=lazy'])
|
|
|
expect(vi.mocked(apiRequest).mock.calls.some(([path]) => /local-vm|computer/.test(path))).toBe(false)
|
|
expect(vi.mocked(apiRequest).mock.calls.some(([path]) => /local-vm|computer/.test(path))).toBe(false)
|
|
|
})
|
|
})
|
|
|
it('recovers an initial server outage while the browser stays online', async () => {
|
|
it('recovers an initial server outage while the browser stays online', async () => {
|
|
@@ -65,7 +65,7 @@ it('recovers an initial server outage while the browser stays online', async ()
|
|
|
await mountView()
|
|
await mountView()
|
|
|
expect(sources).toHaveLength(0)
|
|
expect(sources).toHaveLength(0)
|
|
|
await vi.advanceTimersByTimeAsync(1500); await flushPromises()
|
|
await vi.advanceTimersByTimeAsync(1500); await flushPromises()
|
|
|
- expect(sources.map(source => source.url)).toEqual(['/api/app/events/stream?after=17'])
|
|
|
|
|
|
|
+ expect(sources.map(source => source.url)).toEqual(['/api/app/events/stream?after=17&toolDetails=lazy'])
|
|
|
expect(vi.mocked(apiRequest).mock.calls.filter(([path]) => path === '/api/app/capabilities')).toHaveLength(2)
|
|
expect(vi.mocked(apiRequest).mock.calls.filter(([path]) => path === '/api/app/capabilities')).toHaveLength(2)
|
|
|
})
|
|
})
|
|
|
it('cancels a scheduled initial recovery when the view is destroyed', async () => {
|
|
it('cancels a scheduled initial recovery when the view is destroyed', async () => {
|
|
@@ -101,7 +101,7 @@ it('cancels recovery while offline and restarts it only when connectivity return
|
|
|
await vi.advanceTimersByTimeAsync(10_000)
|
|
await vi.advanceTimersByTimeAsync(10_000)
|
|
|
expect(apiRequest).toHaveBeenCalledTimes(1)
|
|
expect(apiRequest).toHaveBeenCalledTimes(1)
|
|
|
online = true; window.dispatchEvent(new Event('online')); await flushPromises()
|
|
online = true; window.dispatchEvent(new Event('online')); await flushPromises()
|
|
|
- expect(sources.map(source => source.url)).toEqual(['/api/app/events/stream?after=17'])
|
|
|
|
|
|
|
+ expect(sources.map(source => source.url)).toEqual(['/api/app/events/stream?after=17&toolDetails=lazy'])
|
|
|
})
|
|
})
|
|
|
it('aborts a pending detail on going offline and ignores its late response', async () => {
|
|
it('aborts a pending detail on going offline and ignores its late response', async () => {
|
|
|
let online = true, signal: AbortSignal | undefined, release!: (value: unknown) => void
|
|
let online = true, signal: AbortSignal | undefined, release!: (value: unknown) => void
|