| 49 | }; |
| 50 | const render = async (next: BrowserChatDockProps) => { props = next; await act(async () => root.render(<BrowserChatDock {...next} />)); }; |
| 51 | const button = (label: string, scope: ParentNode = document.body) => { |
| 52 | const found = [...scope.querySelectorAll('button')].find(item => item.textContent === label || item.getAttribute('aria-label') === label); |
| 53 | expect(found, `button ${label}`).toBeDefined(); |
| 54 | return found!; |
| 55 | }; |
| 56 | const click = async (label: string, scope?: ParentNode) => { await act(async () => button(label, scope).click()); }; |
| 57 | /** Opens the agent configuration and loads the fake model. */ |
| 58 | const load = async () => { |