mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-22 09:01:45 +03:00
remove test that does nothing
This commit is contained in:
parent
116575386d
commit
c73aedfb87
@ -1,4 +1,3 @@
|
|||||||
import type { BranchData } from '$lib/vbranches';
|
|
||||||
import type { PageLoadEvent } from './$types';
|
import type { PageLoadEvent } from './$types';
|
||||||
import { invoke } from '$lib/ipc';
|
import { invoke } from '$lib/ipc';
|
||||||
import { api } from '$lib';
|
import { api } from '$lib';
|
||||||
@ -7,11 +6,6 @@ async function getRemoteBranches(params: { projectId: string }) {
|
|||||||
return invoke<Array<string>>('git_remote_branches', params);
|
return invoke<Array<string>>('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) {
|
export async function load({ parent, params }: PageLoadEvent) {
|
||||||
const projectId = params.projectId;
|
const projectId = params.projectId;
|
||||||
const remoteBranchNames = await getRemoteBranches({ projectId });
|
const remoteBranchNames = await getRemoteBranches({ projectId });
|
||||||
@ -31,20 +25,3 @@ export async function load({ parent, params }: PageLoadEvent) {
|
|||||||
targetBranchStore
|
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');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user