test: improve tests of CatalogImportClient

Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
Benjamin Janssens
2024-06-06 16:25:58 +02:00
parent f61a4b3d8f
commit e3d0da09dc
@@ -588,6 +588,12 @@ describe('CatalogImportClient', () => {
'https://github.com/backstage/backstage/blob/main/catalog-info.yaml',
});
expect(catalogApi.validateEntity).toHaveBeenCalledTimes(1);
expect(scmAuthApi.getCredentials).toHaveBeenCalledWith({
host: 'github.com',
additionalScope: {
repoWrite: true,
},
});
expect(
(new Octokit().git.createRef as any as jest.Mock).mock.calls[0][0],
).toEqual({
@@ -701,6 +707,13 @@ describe('CatalogImportClient', () => {
}),
);
expect(scmAuthApi.getCredentials).toHaveBeenCalledWith({
host: 'github.com',
additionalScope: {
repoWrite: true,
},
});
expect(
(new Octokit().git.createRef as any as jest.Mock).mock.calls[0][0],
).toEqual(