Api refactor, return object for updateRef & fix snapshot test
Signed-off-by: Erik Engervall <erik.engervall@gmail.com>
This commit is contained in:
@@ -48,7 +48,7 @@ describe('GitReleaseApiClient', () => {
|
||||
"getRepoPath": [Function],
|
||||
"getRepositories": [Function],
|
||||
"getRepository": [Function],
|
||||
"getSingleTag": [Function],
|
||||
"getTag": [Function],
|
||||
"getUser": [Function],
|
||||
"githubAuthApi": Object {
|
||||
"getAccessToken": [MockFunction],
|
||||
|
||||
@@ -390,9 +390,11 @@ export class GitReleaseApiClient implements GitReleaseApi {
|
||||
});
|
||||
|
||||
return {
|
||||
ref: updatedRef.ref,
|
||||
object: {
|
||||
sha: updatedRef.object.sha,
|
||||
reference: {
|
||||
ref: updatedRef.ref,
|
||||
object: {
|
||||
sha: updatedRef.object.sha,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -687,9 +689,11 @@ export interface GitReleaseApi {
|
||||
force: boolean;
|
||||
} & OwnerRepo,
|
||||
) => Promise<{
|
||||
ref: string;
|
||||
object: {
|
||||
sha: string;
|
||||
reference: {
|
||||
ref: string;
|
||||
object: {
|
||||
sha: string;
|
||||
};
|
||||
};
|
||||
}>;
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ export function usePatch({
|
||||
abortIfError(cherryPickRes.error);
|
||||
if (!cherryPickRes.value) return undefined;
|
||||
|
||||
const updatedReference = await pluginApiClient
|
||||
const { reference: updatedReference } = await pluginApiClient
|
||||
.updateRef({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
|
||||
@@ -267,9 +267,11 @@ export const mockApiClient: GitReleaseApi = {
|
||||
})),
|
||||
|
||||
updateRef: jest.fn(async () => ({
|
||||
ref: 'mock_update_ref_ref',
|
||||
object: {
|
||||
sha: 'mock_update_ref_object_sha',
|
||||
reference: {
|
||||
ref: 'mock_update_ref_ref',
|
||||
object: {
|
||||
sha: 'mock_update_ref_object_sha',
|
||||
},
|
||||
},
|
||||
})),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user