fix(test): export VirtualSessionListProps and assert sessions array identity change
This commit is contained in:
parent
09ed1ac950
commit
416f91d271
|
|
@ -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[]
|
||||
|
|
|
|||
Loading…
Reference in New Issue