Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHCLOUD-37159: Remove tests of non-public Integrations v1 endpoints #343

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { describe, expect, test } from '@jest/globals';
import { IntegrationsClient } from '../../api';
import { EndpointResourceV1CreateEndpointParams } from '../../EndpointResourceV1CreateEndpoint';
import { Endpoint, EndpointType, RequestSystemSubscriptionProperties } from '../../types';
import { EndpointResourceV1AddEventTypeToEndpointParams } from '../../EndpointResourceV1AddEventTypeToEndpoint';
import { EndpointResourceV1DeleteEventTypeFromEndpointParams } from '../../EndpointResourceV1DeleteEventTypeFromEndpoint';
import { EndpointResourceV1DeleteEndpointParams } from '../../EndpointResourceV1DeleteEndpoint';
import { EndpointResourceV1EnableEndpointParams } from '../../EndpointResourceV1EnableEndpoint';
import { EndpointResourceV1DisableEndpointParams } from '../../EndpointResourceV1DisableEndpoint';
Expand All @@ -16,7 +14,6 @@ import { EndpointResourceV1GetOrCreateDrawerSubscriptionEndpointParams } from '.
import { EndpointResourceV1GetOrCreateEmailSubscriptionEndpointParams } from '../../EndpointResourceV1GetOrCreateEmailSubscriptionEndpoint';
import { EndpointResourceV1UpdateEndpointParams } from '../../EndpointResourceV1UpdateEndpoint';
import { EndpointResourceV1UpdateEventTypesLinkedToEndpointParams } from '../../EndpointResourceV1UpdateEventTypesLinkedToEndpoint';
import { AxiosError } from 'axios';

// note the 1.0, which is different from, for example, RBAC v1
const BASE_PATH = 'http://localhost:3001/api/integrations/v1.0/';
Expand All @@ -38,58 +35,11 @@ describe('Integrations API (v1)', () => {
expect(createEndpointResp.status).toEqual(200);
});

test('add event type from endpoint params', async () => {
const addEventTypeParams: EndpointResourceV1AddEventTypeToEndpointParams = {
endpointId: placeHolder,
eventTypeId: placeHolder,
};
const addEventTypeResp = await client.endpointResourceV1AddEventTypeToEndpoint(addEventTypeParams).catch((error: AxiosError) => {
expect(error.message).toContain('404');
});
if (!addEventTypeResp) {
return;
}
expect(addEventTypeResp.status).toEqual(204);
});

test('remove event type from endpoint params', async () => {
const removeEventTypeParams: EndpointResourceV1DeleteEventTypeFromEndpointParams = {
endpointId: placeHolder,
eventTypeId: placeHolder,
};
const removeEventTypeResp = await client.endpointResourceV1DeleteEventTypeFromEndpoint(removeEventTypeParams).catch((error: AxiosError) => {
expect(error.message).toContain('404');
});
if (!removeEventTypeResp) {
return;
}
expect(removeEventTypeResp).toEqual(204);
});

test('delete event type from endpoint', async () => {
const deleteEventTypeParams: EndpointResourceV1DeleteEventTypeFromEndpointParams = {
endpointId: placeHolder,
eventTypeId: placeHolder,
};
const deleteEventTypeResp = await client.endpointResourceV1DeleteEventTypeFromEndpoint(deleteEventTypeParams).catch((error: AxiosError) => {
expect(error.message).toContain('404');
});
if (!deleteEventTypeResp) {
return;
}
expect(deleteEventTypeResp.status).toEqual(204);
});

test('delete endpoint', async () => {
const deleteEndpointParams: EndpointResourceV1DeleteEndpointParams = {
id: placeHolder,
};
const deleteEndpointResp = await client.endpointResourceV1DeleteEndpoint(deleteEndpointParams).catch((error: AxiosError) => {
expect(error.message).toContain('404');
});
if (!deleteEndpointResp) {
return;
}
const deleteEndpointResp = await client.endpointResourceV1DeleteEndpoint(deleteEndpointParams);
expect(deleteEndpointResp.status).toEqual(204);
});

Expand All @@ -103,12 +53,7 @@ describe('Integrations API (v1)', () => {

test('disable endpoint', async () => {
const disableEndpointParams: EndpointResourceV1DisableEndpointParams = { id: placeHolder };
const disableResp = await client.endpointResourceV1DisableEndpoint(disableEndpointParams).catch((error: AxiosError) => {
expect(error).toContain('404');
});
if (!disableResp) {
return;
}
const disableResp = await client.endpointResourceV1DisableEndpoint(disableEndpointParams);
expect(disableResp.status).toEqual(204);
});

Expand Down
Loading