({ project }: { project: string })
| 81 | .mockImplementation(() => new Promise(() => undefined)); |
| 82 | const observed: { project: string; events: number; hello: boolean; status: string }[] = []; |
| 83 | function Observe({ project }: { project: string }): null { |
| 84 | const current = useAgentStream({ on: true, project, fetch }); |
| 85 | useLayoutEffect(() => { |
| 86 | observed.push({ project, events: current.state.events, |
| 87 | hello: current.status.hello !== undefined, status: current.status.state }); |
| 88 | }); |
| 89 | return null; |
| 90 | } |
| 91 | await act(async () => root.render(<Observe project="one" />)); |
| 92 | expect(observed.at(-1)).toMatchObject({ project: 'one', events: 1, hello: true, status: 'connected' }); |
| 93 | await act(async () => root.render(<Observe project="two" />)); |
nothing calls this directly
no test coverage detected