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。

test(devices): align sidebar expectations with readable labels

Chriscc5a360999ef
diff --git a/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsx b/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsx
index e4fc61d436..e527c6c43f 100644
--- a/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsx
+++ b/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsx
@@ -308,9 +308,9 @@ describe('Offline device header names', () => {
expect(screen.queryByText('offline')).toBeNull();
});
- it('still falls back to the device ID when no name is known', () => {
+ it('uses a readable fallback when no device name is known', () => {
render(<ProjectsSection {...cachedProjectProps()} />);
- expect(screen.getByText('offline')).toBeTruthy();
+ expect(screen.getByText('another computer')).toBeTruthy();
});
it('does not enable device grouping when only disconnected devices remain', () => {
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/teammatesSection.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/teammatesSection.test.tsx
index 374eb6b3f9..b6a7d5032e 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/teammatesSection.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/teammatesSection.test.tsx
@@ -322,7 +322,7 @@ describe('teammate host labels', () => {
mocks.remoteBots = mocks.remoteBots.map((bot) => ({ ...bot, online: false, deviceName: ' ' }));
view.rerender(<TeammatesSection />);
- expect(screen.getByText('bots.remote.offline · remote-device')).toBeTruthy();
+ expect(screen.getByText('bots.remote.offline · another computer')).toBeTruthy();
expect(screen.queryByText('bots.remote.offline · bots.remote.thisDevice')).toBeNull();
});
@@ -348,8 +348,8 @@ describe('teammate host labels', () => {
activityAt: 1, sessionId: 'remote-session', online: true,
}));
const view = await renderSidebar();
- expect(screen.getByText('Shared Mac (host-a)')).toBeTruthy();
- expect(screen.getByText('Shared Mac (host-b)')).toBeTruthy();
+ expect(screen.getByText('Shared Mac (1)')).toBeTruthy();
+ expect(screen.getByText('Shared Mac (2)')).toBeTruthy();
expect(view.container.innerHTML).not.toContain('local-device');
mocks.remoteBots = mocks.remoteBots.map((entry) => ({ ...entry, deviceName: entry.deviceId === 'host-a' ? 'Studio' : 'Mini' }));
view.rerender(<TeammatesSection />);