Add test when group parameter is not set

Signed-off-by: angom1 <angom@poppulo.com>
This commit is contained in:
angom1
2023-07-17 12:04:12 +01:00
parent d2f13494d8
commit 1d2d469d31
@@ -543,6 +543,42 @@ describe('GitlabOrgDiscoveryEntityProvider', () => {
);
});
it('fail with scheduler but no group config when host is gitlab.com', () => {
const scheduler = {
createScheduledTaskRunner: (_: any) => jest.fn(),
} as unknown as PluginTaskScheduler;
const config = new ConfigReader({
integrations: {
gitlab: [
{
host: 'test-gitlab',
apiBaseUrl: 'https://api.gitlab.example/api/v4',
token: '1234',
},
],
},
catalog: {
providers: {
gitlab: {
'test-id': {
host: 'gitlab.com',
orgEnabled: true,
},
},
},
},
});
expect(() =>
GitlabOrgDiscoveryEntityProvider.fromConfig(config, {
logger,
scheduler,
}),
).toThrow(
`Missing 'group' value for GitlabOrgDiscoveryEntityProvider:test-id`,
);
});
it('single simple provider config with schedule in config', async () => {
const schedule = new PersistingTaskRunner();
const scheduler = {