Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions apps/web/src/routers/admin-github-router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { createCallerForUser } from '@/routers/test-utils';
import { insertTestUser } from '@/tests/helpers/user.helper';
import type { User } from '@kilocode/db/schema';
import {
getKilocodeRepoOpenPullRequestCounts,
getKilocodeRepoOpenPullRequestsSummary,
getKilocodeRepoRecentlyClosedExternalPRs,
getKilocodeRepoRecentlyMergedExternalPRs,
} from '@/lib/github/open-pull-request-counts';

jest.mock('@/lib/github/open-pull-request-counts', () => ({
Expand Down Expand Up @@ -41,22 +39,6 @@ describe('admin.github.getKilocodeOpenPullRequestCounts', () => {
'Admin access required'
);
});

it('returns PR counts for admin users', async () => {
const mockCounts = {
totalOpenPullRequests: 10,
teamOpenPullRequests: 4,
externalOpenPullRequests: 6,
updatedAt: new Date('2020-01-01T00:00:00.000Z').toISOString(),
};

(getKilocodeRepoOpenPullRequestCounts as jest.Mock).mockResolvedValue(mockCounts);

const caller = await createCallerForUser(adminUser.id);
const result = await caller.admin.github.getKilocodeOpenPullRequestCounts();

expect(result).toEqual(mockCounts);
});
});

describe('admin.github.getKilocodeOpenPullRequestsSummary', () => {
Expand Down Expand Up @@ -103,32 +85,6 @@ describe('admin.github.getKilocodeRecentlyMergedExternalPRs', () => {
'Admin access required'
);
});

it('returns recently merged external PRs for admin users', async () => {
const mockMergedPrs = [
{
number: 456,
title: 'External feature',
url: 'https://github.com/Kilo-Org/kilocode/pull/456',
authorLogin: 'external-contributor',
mergedAt: new Date('2024-01-15T10:00:00.000Z').toISOString(),
},
{
number: 789,
title: 'Another fix',
url: 'https://github.com/Kilo-Org/kilocode/pull/789',
authorLogin: 'community-dev',
mergedAt: new Date('2024-01-14T08:00:00.000Z').toISOString(),
},
];

(getKilocodeRepoRecentlyMergedExternalPRs as jest.Mock).mockResolvedValue(mockMergedPrs);

const caller = await createCallerForUser(adminUser.id);
const result = await caller.admin.github.getKilocodeRecentlyMergedExternalPRs();

expect(result).toEqual(mockMergedPrs);
});
});

describe('admin.github.getKilocodeRecentlyClosedExternalPRs', () => {
Expand Down
27 changes: 0 additions & 27 deletions apps/web/src/routers/admin-kiloclaw-providers-router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,6 @@ describe('admin KiloClaw provider rollout router', () => {
});
});

it('returns provider rollout config from the Worker', async () => {
kiloclawClientMock.__getProviderRolloutMock.mockResolvedValue({
rollout: {
northflank: {
personalTrafficPercent: 0,
organizationTrafficPercent: 0,
enabledOrganizationIds: [],
},
},
availability: { northflank: false },
source: 'default',
});
const caller = await createCallerForUser(adminUser.id);

await expect(caller.admin.kiloclawProviders.getRollout()).resolves.toEqual({
rollout: {
northflank: {
personalTrafficPercent: 0,
organizationTrafficPercent: 0,
enabledOrganizationIds: [],
},
},
availability: { northflank: false },
source: 'default',
});
});

it('updates provider rollout config through the Worker', async () => {
const input = {
northflank: {
Expand Down