mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 00:03:47 +00:00
test(agent-map): guard completion burst paint budget
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// @vitest-environment happy-dom
|
||||
|
||||
import '@testing-library/jest-dom/vitest'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { card, installAgentMapEnvironment, renderMap } from './agent-map-render-test-harness'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { card, installAgentMapEnvironment, NOW, renderMap } from './agent-map-render-test-harness'
|
||||
|
||||
describe('AgentMap status glow', () => {
|
||||
installAgentMapEnvironment()
|
||||
@@ -29,4 +29,27 @@ describe('AgentMap status glow', () => {
|
||||
expect(glow).not.toBeInTheDocument()
|
||||
}
|
||||
)
|
||||
|
||||
it('caps a 200-completion burst at four flares without dropping static emphasis', () => {
|
||||
const clock = vi.spyOn(Date, 'now').mockReturnValue(NOW)
|
||||
const { container } = renderMap(
|
||||
Array.from({ length: 200 }, (_, index) =>
|
||||
card({
|
||||
paneKey: `pane-${index}`,
|
||||
ptyId: `pty-${index}`,
|
||||
leafId: `leaf-${index}`,
|
||||
bucket: 'done',
|
||||
dotState: 'done',
|
||||
unseen: true,
|
||||
stateChangedAt: NOW
|
||||
})
|
||||
)
|
||||
)
|
||||
clock.mockRestore()
|
||||
|
||||
expect(container.querySelectorAll('[data-agent-map-agent-finish-flare]')).toHaveLength(4)
|
||||
expect(container.querySelectorAll('[data-agent-map-agent-status-glow]')).toHaveLength(200)
|
||||
expect(container.querySelectorAll('.fleet-status-done .agent-map-agent-mark')).toHaveLength(200)
|
||||
expect(container.querySelectorAll('[data-agent-unread-marker]')).toHaveLength(200)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user