mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 14:31:30 +03:00
chore: cleanup fixtures
This commit is contained in:
parent
1081ca1c6d
commit
72be19a3f2
@ -1,6 +1,4 @@
|
||||
// import type { Project } from '$lib/backend/projects'
|
||||
// import type { User } from '$lib/stores/user'
|
||||
// import type { BaseBranch, RemoteCommit, Author, RemoteBranchData } from '$lib/vbranches/types'
|
||||
import type { User } from '$lib/stores/user'
|
||||
|
||||
export type Constructor<T = any> = new (...args: any[]) => T;
|
||||
export type Class<T = any> = InstanceType<Constructor<T>>;
|
||||
@ -25,11 +23,10 @@ export const project = {
|
||||
title: "home2021"
|
||||
}
|
||||
|
||||
// export const author: Class<Author> = {
|
||||
export const author = {
|
||||
name: 'John Snow',
|
||||
email: 'user@company.com',
|
||||
gravatarUrl: 'https://gravatar.com/abc123',
|
||||
gravatarUrl: 'https://gravatar.com/avatar/abc123'
|
||||
}
|
||||
|
||||
export const remoteCommit0 = {
|
||||
@ -66,8 +63,7 @@ export const baseBranch = {
|
||||
lastFetchedMs: 1714843209991,
|
||||
}
|
||||
|
||||
// export const user: Class<User> = {
|
||||
export const user = {
|
||||
export const user: User = {
|
||||
access_token: "c5da8ec0-2a2e-4f1c-a796-686c5606e566",
|
||||
created_at: "2024-05-04T13:27:30Z",
|
||||
email: "yo@ndo.dev",
|
||||
@ -81,9 +77,9 @@ export const user = {
|
||||
picture: "https://source.boringavatar.com/marble/120",
|
||||
role: undefined,
|
||||
updated_at: "2024-05-05T15:38:02Z",
|
||||
supporter: false
|
||||
}
|
||||
|
||||
// export const remoteBranchData: Class<RemoteBranchData> = {
|
||||
export const remoteBranchData = {
|
||||
sha: '90c225edcc74b31718a9cd8963c1bc89c17d8864',
|
||||
name: 'test',
|
||||
|
@ -3,25 +3,23 @@ import { mockIPC } from "@tauri-apps/api/mocks";
|
||||
import { mockWindows } from '@tauri-apps/api/mocks';
|
||||
|
||||
export function mockTauri() {
|
||||
mockWindows('main');
|
||||
mockIPC((cmd, args) => {
|
||||
console.log("MOCKIPC.CMD", cmd, args)
|
||||
console.log(`%c${cmd}`, 'background: #222; color: #4db2ad', args)
|
||||
|
||||
// Open Project Dialog
|
||||
if (cmd === "tauri" && args.__tauriModule === "Dialog" && args.message?.cmd === "openDialog") {
|
||||
// @ts-expect-error 'message' is dynamic
|
||||
if (cmd === "tauri" && args.message?.cmd === "openDialog") {
|
||||
return "/Users/user/project"
|
||||
}
|
||||
|
||||
// List Projects
|
||||
if (cmd === "list_projects") {
|
||||
return [project]
|
||||
}
|
||||
|
||||
// List Project
|
||||
if (cmd === "get_project" && args.id === "ac44a3bb-8bbb-4af9-b8c9-7950dd9ec295") {
|
||||
return project
|
||||
}
|
||||
|
||||
// Get HEAD
|
||||
if (cmd === "git_head") {
|
||||
return "refs/heads/gitbutler/integration"
|
||||
}
|
||||
@ -58,6 +56,4 @@ export function mockTauri() {
|
||||
return user
|
||||
}
|
||||
});
|
||||
mockWindows('main');
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user