From c73aedfb87f0d21ac076c55bc7a4f642a328b169 Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Sun, 16 Jul 2023 13:07:01 +0200 Subject: [PATCH] remove test that does nothing --- src/routes/repo/[projectId]/+page.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/routes/repo/[projectId]/+page.ts b/src/routes/repo/[projectId]/+page.ts index b8c7ce39b..4addaade9 100644 --- a/src/routes/repo/[projectId]/+page.ts +++ b/src/routes/repo/[projectId]/+page.ts @@ -1,4 +1,3 @@ -import type { BranchData } from '$lib/vbranches'; import type { PageLoadEvent } from './$types'; import { invoke } from '$lib/ipc'; import { api } from '$lib'; @@ -7,11 +6,6 @@ async function getRemoteBranches(params: { projectId: string }) { return invoke>('git_remote_branches', params); } -function sortBranchData(branchData: BranchData[]): BranchData[] { - // sort remote_branches_data by date - return branchData.sort((a, b) => b.lastCommitTs - a.lastCommitTs); -} - export async function load({ parent, params }: PageLoadEvent) { const projectId = params.projectId; const remoteBranchNames = await getRemoteBranches({ projectId }); @@ -31,20 +25,3 @@ export async function load({ parent, params }: PageLoadEvent) { targetBranchStore }; } - -if (import.meta.vitest) { - const { it, expect } = import.meta.vitest; - it('sorts by last commit timestamp', () => { - const bd: BranchData[] = [ - { - sha: 'a', - lastCommitTs: 1 - } as BranchData, - { - sha: 'b', - lastCommitTs: 2 - } as BranchData - ]; - expect(sortBranchData(bd)[0].sha).toBe('b'); - }); -}