The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(desktop): mock the paginating archive loader in the unarchive fixture
Brooklyn Nicholsonf6daab0eb7f6
diff --git a/apps/desktop/src/app/settings/sessions-settings.test.tsx b/apps/desktop/src/app/settings/sessions-settings.test.tsxindex 73f94b8ce90..3a7eb077859 100644--- a/apps/desktop/src/app/settings/sessions-settings.test.tsx+++ b/apps/desktop/src/app/settings/sessions-settings.test.tsx@@ -2,7 +2,7 @@import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'-import { listAllProfileSessions, setSessionArchived } from '@/hermes'+import { setSessionArchived } from '@/hermes'import { en } from '@/i18n/en'import { $messagingSessions, $sessions, setMessagingSessions, setSessions } from '@/store/session'import type { SessionInfo } from '@/types/hermes'@@ -14,10 +14,18 @@ vi.mock('@/i18n', () => ({ useI18n: () => ({ t: en }) }))vi.mock('@/hermes', async importOriginal => ({...(await importOriginal<Record<string, unknown>>()),getHermesConfigRecord: vi.fn().mockResolvedValue({ config: {} }),- listAllProfileSessions: vi.fn(),setSessionArchived: vi.fn().mockResolvedValue(undefined)}))+// The settings page loads its archived list through the paginating store helper,+// which reads the sessions API module directly — mock that seam, not the barrel.+const listEveryArchivedSession = vi.hoisted(() => vi.fn())++vi.mock('@/store/sidebar-archive', async importOriginal => ({+ ...(await importOriginal<Record<string, unknown>>()),+ listEveryArchivedSession+}))+const archivedMatrixSession = {archived: true,ended_at: null,@@ -38,7 +46,7 @@ const archivedMatrixSession = {beforeEach(() => {setSessions([])setMessagingSessions([])- vi.mocked(listAllProfileSessions).mockResolvedValue({ sessions: [archivedMatrixSession], total: 1 } as never)+ listEveryArchivedSession.mockReset().mockResolvedValue([archivedMatrixSession])})afterEach(() => {