feat: phase 6 of git implementation
This commit is contained in:
@@ -147,6 +147,7 @@ const mockGitEngine = {
|
||||
getDiff: vi.fn(),
|
||||
getDiffContent: vi.fn(),
|
||||
getHistory: vi.fn(),
|
||||
getRemoteState: vi.fn(),
|
||||
fetch: vi.fn(),
|
||||
pull: vi.fn(),
|
||||
push: vi.fn(),
|
||||
@@ -361,6 +362,29 @@ describe('IPC Handlers', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('git:remoteState', () => {
|
||||
it('should pass project path to GitEngine.getRemoteState', async () => {
|
||||
mockGitEngine.getRemoteState.mockResolvedValue({
|
||||
localBranch: 'main',
|
||||
upstreamBranch: 'origin/main',
|
||||
hasUpstream: true,
|
||||
ahead: 2,
|
||||
behind: 1,
|
||||
});
|
||||
|
||||
const result = await invokeHandler('git:remoteState', '/repo');
|
||||
|
||||
expect(mockGitEngine.getRemoteState).toHaveBeenCalledWith('/repo');
|
||||
expect(result).toEqual({
|
||||
localBranch: 'main',
|
||||
upstreamBranch: 'origin/main',
|
||||
hasUpstream: true,
|
||||
ahead: 2,
|
||||
behind: 1,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('git:diffContent', () => {
|
||||
it('should pass project path and file path to GitEngine.getDiffContent', async () => {
|
||||
mockGitEngine.getDiffContent.mockResolvedValue({
|
||||
|
||||
Reference in New Issue
Block a user