diff --git a/apps/desktop/src/renderer/components/gitlab-merge-requests/hooks/useGitLabMRFiltering.ts b/apps/desktop/src/renderer/components/gitlab-merge-requests/hooks/useGitLabMRFiltering.ts index b5db531b..22772655 100644 --- a/apps/desktop/src/renderer/components/gitlab-merge-requests/hooks/useGitLabMRFiltering.ts +++ b/apps/desktop/src/renderer/components/gitlab-merge-requests/hooks/useGitLabMRFiltering.ts @@ -204,8 +204,8 @@ export function useGitLabMRFiltering( setFiltersState(prev => ({ ...prev, searchQuery: query })); }, []); - const setContributors = useCallback((contributors: string[]) => { - setFiltersState(prev => ({ ...prev, contributors })); + const setContributors = useCallback((selected: string[]) => { + setFiltersState(prev => ({ ...prev, contributors: selected })); }, []); const setStatuses = useCallback((statuses: GitLabMRStatusFilter[]) => { diff --git a/apps/desktop/src/shared/integrations/pagination/__tests__/pagination-utils.test.ts b/apps/desktop/src/shared/integrations/pagination/__tests__/pagination-utils.test.ts index 6a2a323d..6a353051 100644 --- a/apps/desktop/src/shared/integrations/pagination/__tests__/pagination-utils.test.ts +++ b/apps/desktop/src/shared/integrations/pagination/__tests__/pagination-utils.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { calculateHasMore, appendWithoutDuplicates } from '../pagination-utils'; +import { calculateHasMore, appendWithoutDuplicates, getNextPage, resetPagination } from '../pagination-utils'; describe('pagination-utils', () => { it('should calculate hasMore correctly', () => { @@ -27,4 +27,16 @@ describe('pagination-utils', () => { const result = appendWithoutDuplicates(existing, newItems, 'id'); expect(result).toHaveLength(2); }); + + it('should get next page', () => { + expect(getNextPage(1)).toBe(2); + expect(getNextPage(5)).toBe(6); + expect(getNextPage(0)).toBe(1); + }); + + it('should reset pagination', () => { + const result = resetPagination(); + expect(result.currentPage).toBe(1); + expect(result.hasMore).toBe(true); + }); });