mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 00:03:45 +00:00
test(activity): tighten readiness regression coverage
This commit is contained in:
@@ -55,7 +55,10 @@ import {
|
||||
reconcileActivityPortalThreads,
|
||||
resolveActivityPortalSwap
|
||||
} from './activity-portal-thread-reconciliation'
|
||||
import { createActivityPortalReadinessLatch } from './activity-portal-readiness-oscillation'
|
||||
import {
|
||||
createActivityPortalReadinessLatch,
|
||||
type ActivityPortalReadinessStatus
|
||||
} from './activity-portal-readiness-oscillation'
|
||||
import type { Repo, TerminalTab, Worktree } from '../../../../shared/types'
|
||||
import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants'
|
||||
import {
|
||||
@@ -136,7 +139,7 @@ type ActivityThreadGroup = {
|
||||
type ActivityTerminalPortalReadiness = {
|
||||
target: HTMLElement | null
|
||||
paneKey: string | null
|
||||
status: 'loading' | 'ready' | 'unavailable'
|
||||
status: ActivityPortalReadinessStatus
|
||||
}
|
||||
|
||||
type ActivityTerminalPortalDomStatus = {
|
||||
@@ -363,7 +366,6 @@ export function useActivityTerminalPortalStatus(
|
||||
updateReadiness('loading')
|
||||
}
|
||||
|
||||
updateReadiness('loading')
|
||||
checkReadiness()
|
||||
|
||||
const observer = new MutationObserver(checkReadiness)
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ describe('Activity portal readiness subscription churn', () => {
|
||||
expect(renders).toBeLessThanOrEqual(31)
|
||||
|
||||
await act(async () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 30))
|
||||
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()))
|
||||
})
|
||||
expect(status).toBe('unavailable')
|
||||
expect(renders).toBeLessThanOrEqual(32)
|
||||
|
||||
Reference in New Issue
Block a user