Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

Merge remote-tracking branch 'origin/main' into feat/mobile-home-chat-chrome

kirozeng6afee6c41fc8
diff --cc apps/mobile/src/__tests__/TeammateList.test.tsx
index 2d16ff0ef8,c81a3a365c..0e57d10ed7
--- a/apps/mobile/src/__tests__/TeammateList.test.tsx
+++ b/apps/mobile/src/__tests__/TeammateList.test.tsx
@@@ -168,19 -168,13 +168,30 @@@ it('mixes group chats into the list by
expect(onGroup).toHaveBeenCalledWith(group);
});
+it('reserves the native home bar once for content, scroll indicator and refresh; other routes keep automatic insets', async () => {
+ const props = { items: [item], error: null, isOnline: () => true, loading: false, refreshing: false, onRefresh: vi.fn(), onSelect: vi.fn() };
+ await act(async () => root.render(el(TeammateList, { ...props, topInset: 106, notice: el('span', null, 'Preference could not be saved') })));
+ expect(Object.assign({}, ...h.list.contentContainerStyle.filter(Boolean)).paddingTop).toBe(106);
+ expect(h.list.contentInsetAdjustmentBehavior).toBe('never');
+ expect(h.list.automaticallyAdjustsScrollIndicatorInsets).toBe(false);
+ expect(h.list.scrollIndicatorInsets).toEqual({ top: 106 });
+ expect(h.list.refreshControl.props.progressViewOffset).toBe(106);
+ expect(node.textContent).toContain('Preference could not be saved');
+ await act(async () => root.render(el(TeammateList, { ...props,
+ scrollInsetProps: { contentInsetAdjustmentBehavior: 'automatic', automaticallyAdjustsScrollIndicatorInsets: true },
+ })));
+ expect(h.list.contentInsetAdjustmentBehavior).toBe('automatic');
+ expect(h.list.automaticallyAdjustsScrollIndicatorInsets).toBe(true);
+ expect(h.list.scrollIndicatorInsets).toBeUndefined();
+});
++
+ it.each([false, null, true])('opens cached teammates while connection evidence is %s and the roster is unverified', async connected => {
+ const select = vi.fn();
+ await act(async () => root.render(el(TeammateList, { items: [item], error: null, isOnline: () => false,
+ connectionState: () => connected, loading: false, refreshing: false, onRefresh: vi.fn(), onSelect: select, embedded: true })));
+ const button = node.querySelector<HTMLButtonElement>('[data-testid="teammates.item.host.bot"]')!;
+ expect(button.disabled).toBe(false);
+ await act(async () => button.click());
+ expect(select).toHaveBeenCalledExactlyOnceWith(item);
+ if (connected === true) expect(button.textContent).not.toContain('devices.resources.hostOffline');
+ });