Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
bnechyporenko
2024-02-20 08:40:55 +01:00
committed by blam
parent ab123770de
commit d1cd9605e9
2 changed files with 10 additions and 6 deletions
@@ -92,6 +92,11 @@ describe('fetch:cookiecutter', () => {
help: 'me',
},
},
templateInfo: {
entityRef: 'template:default/cookiecutter',
baseUrl: 'somebase',
},
workspacePath: mockTmpDir,
});
mockDir.setContent({ template: {} });
@@ -54,9 +54,12 @@ describe('github:autolinks:create', () => {
const integrations = ScmIntegrations.fromConfig(config);
let githubCredentialsProvider: GithubCredentialsProvider;
let action: TemplateAction<any, any>;
const input = yaml.parse(examples[0].example).steps[0].input;
const mockContext = createMockActionContext({
input,
});
it('should call the githubApis for creating autolink reference', async () => {
const input = yaml.parse(examples[0].example).steps[0].input;
githubCredentialsProvider =
DefaultGithubCredentialsProvider.fromIntegrations(integrations);
action = createGithubAutolinksAction({
@@ -69,11 +72,7 @@ describe('github:autolinks:create', () => {
id: '1',
},
});
await action.handler(
createMockActionContext({
input,
}),
);
await action.handler(mockContext);
expect(mockOctokit.rest.repos.createAutolink).toHaveBeenCalledWith({
owner: 'owner',