fix(test): export VirtualSessionListProps and assert sessions array identity change

This commit is contained in:
StanleyStetson
2026-08-01 02:02:30 +03:00
committed by kshitij
parent 09ed1ac950
commit 416f91d271
2 changed files with 24 additions and 1 deletions
@@ -155,5 +155,28 @@ describe('SidebarSessionsSection memoization & virtualizer stability', () => {
const secondRowsRef = mockVirtualListPropsHistory[1].rows
expect(secondRowsRef).not.toBe(firstRowsRef)
// Change sessions array identity
const updatedSessions = generateSessions(VIRTUALIZE_THRESHOLD + 4)
rerender(
<SidebarSessionsSection
activeSessionId={null}
dateGrouped={true}
emptyState={<div>Empty</div>}
label="Sessions"
onArchiveSession={noop}
onDeleteSession={noop}
onResumeSession={noop}
onToggle={noop}
onTogglePin={noop}
open={true}
pinned={false}
sessions={updatedSessions}
workingSessionIdSet={new Set()}
/>
)
const thirdRowsRef = mockVirtualListPropsHistory[2].rows
expect(thirdRowsRef).not.toBe(secondRowsRef)
})
})
@@ -27,7 +27,7 @@ interface SessionRowCommonProps {
showProfile?: boolean
}
interface VirtualSessionListProps {
export interface VirtualSessionListProps {
activeSessionId: null | string
className?: string
rows: SidebarListRow[]