Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

test(ui): dispatch the desktop Settings request once its listener is installed (#2396)

Call White40d3f5f74433
diff --git a/ui/src/App.remoteAuth.test.tsx b/ui/src/App.remoteAuth.test.tsx
index e76c2f783..7fb19db17 100644
--- a/ui/src/App.remoteAuth.test.tsx
+++ b/ui/src/App.remoteAuth.test.tsx
@@ -247,6 +247,8 @@ describe('AuthGuard General Settings over setup', () => {
return <div>at {pathname}</div>;
};
+ const addListener = vi.spyOn(window, 'addEventListener');
+
try {
render(
<MemoryRouter initialEntries={['/setup']}>
@@ -259,6 +261,9 @@ describe('AuthGuard General Settings over setup', () => {
</MemoryRouter>,
);
expect(await screen.findByText('at /setup')).toBeTruthy();
+ // The command listens from a passive effect, which can still be pending after the
+ // commit that shows the wizard; the shell's event is only answered once it listens.
+ await waitFor(() => expect(addListener).toHaveBeenCalledWith(DESKTOP_OPEN_SETTINGS_EVENT, expect.any(Function)));
act(() => {
window.dispatchEvent(new Event(DESKTOP_OPEN_SETTINGS_EVENT, { cancelable: true }));
@@ -268,6 +273,7 @@ describe('AuthGuard General Settings over setup', () => {
expect(mounts.count).toBe(1);
expect(api.getConfig).toHaveBeenCalledOnce();
} finally {
+ addListener.mockRestore();
Reflect.deleteProperty(window, '__AVIBE_DESKTOP_SHELL__');
}
});