Skip to content

Commit d298930

Browse files
committed
test(tables): remove background-drain describe block (behavior intentionally removed)
1 parent 414ca52 commit d298930

1 file changed

Lines changed: 0 additions & 66 deletions

File tree

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/hooks/use-table.test.ts

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ vi.mock('@/lib/table/constants', () => ({
7070
}))
7171

7272
import { useTable } from '@/app/workspace/[workspaceId]/tables/[tableId]/hooks/use-table'
73-
import { useInfiniteTableRows } from '@/hooks/queries/tables'
7473

7574
const WORKSPACE_ID = 'ws-1'
7675
const TABLE_ID = 'tbl-1'
@@ -237,68 +236,3 @@ describe('useTable – ensureAllRowsLoaded', () => {
237236
expect(JSON.stringify(queryKey)).toContain('Alice')
238237
})
239238
})
240-
241-
describe('useTable – background drain on mount', () => {
242-
it('calls fetchNextPage when hasNextPage is true', () => {
243-
vi.mocked(useInfiniteTableRows).mockReturnValueOnce({
244-
data: { pages: [] },
245-
isLoading: false,
246-
refetch: vi.fn().mockResolvedValue(undefined),
247-
fetchNextPage: mockFetchNextPage,
248-
hasNextPage: true,
249-
isFetchingNextPage: false,
250-
})
251-
useTable({ workspaceId: WORKSPACE_ID, tableId: TABLE_ID, queryOptions: QUERY_OPTIONS })
252-
for (const effect of capturedEffects) effect()
253-
expect(mockFetchNextPage).toHaveBeenCalled()
254-
})
255-
256-
it('does not call fetchNextPage when hasNextPage is false', () => {
257-
// Default mock already returns hasNextPage: false.
258-
useTable({ workspaceId: WORKSPACE_ID, tableId: TABLE_ID, queryOptions: QUERY_OPTIONS })
259-
for (const effect of capturedEffects) effect()
260-
expect(mockFetchNextPage).not.toHaveBeenCalled()
261-
})
262-
263-
it('does not call fetchNextPage when isFetchingNextPage is true', () => {
264-
vi.mocked(useInfiniteTableRows).mockReturnValueOnce({
265-
data: { pages: [] },
266-
isLoading: false,
267-
refetch: vi.fn().mockResolvedValue(undefined),
268-
fetchNextPage: mockFetchNextPage,
269-
hasNextPage: true,
270-
isFetchingNextPage: true,
271-
})
272-
useTable({ workspaceId: WORKSPACE_ID, tableId: TABLE_ID, queryOptions: QUERY_OPTIONS })
273-
for (const effect of capturedEffects) effect()
274-
expect(mockFetchNextPage).not.toHaveBeenCalled()
275-
})
276-
277-
it('does not drain when workspaceId is empty', () => {
278-
vi.mocked(useInfiniteTableRows).mockReturnValueOnce({
279-
data: { pages: [] },
280-
isLoading: false,
281-
refetch: vi.fn().mockResolvedValue(undefined),
282-
fetchNextPage: mockFetchNextPage,
283-
hasNextPage: true,
284-
isFetchingNextPage: false,
285-
})
286-
useTable({ workspaceId: '', tableId: TABLE_ID, queryOptions: QUERY_OPTIONS })
287-
for (const effect of capturedEffects) effect()
288-
expect(mockFetchNextPage).not.toHaveBeenCalled()
289-
})
290-
291-
it('does not drain when tableId is empty', () => {
292-
vi.mocked(useInfiniteTableRows).mockReturnValueOnce({
293-
data: { pages: [] },
294-
isLoading: false,
295-
refetch: vi.fn().mockResolvedValue(undefined),
296-
fetchNextPage: mockFetchNextPage,
297-
hasNextPage: true,
298-
isFetchingNextPage: false,
299-
})
300-
useTable({ workspaceId: WORKSPACE_ID, tableId: '', queryOptions: QUERY_OPTIONS })
301-
for (const effect of capturedEffects) effect()
302-
expect(mockFetchNextPage).not.toHaveBeenCalled()
303-
})
304-
})

0 commit comments

Comments
 (0)