Skip to content

Commit

Permalink
[Obs AI Assistant] Remove URL constant (#204884)
Browse files Browse the repository at this point in the history
  • Loading branch information
viduni94 committed Jan 3, 2025
1 parent 9470903 commit 6beb135
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import type {
SupertestWithoutAuthProviderType,
} from '../../../../../../shared/services';

const CONNECTOR_API_URL = '/internal/observability_ai_assistant/connectors';

export default function ApiTest({ getService }: FtrProviderContext) {
const observabilityAIAssistantAPIClient = getService('observabilityAIAssistantAPIClient');
const supertestWithoutAuth = getService('supertestWithoutAuth');
Expand Down Expand Up @@ -49,14 +47,14 @@ export default function ApiTest({ getService }: FtrProviderContext) {
it('Returns a 2xx for enterprise license', async () => {
await observabilityAIAssistantAPIClient
.slsEditor({
endpoint: `GET ${CONNECTOR_API_URL}`,
endpoint: `GET /internal/observability_ai_assistant/connectors`,
})
.expect(200);
});

it('returns an empty list of connectors', async () => {
const res = await observabilityAIAssistantAPIClient.slsEditor({
endpoint: `GET ${CONNECTOR_API_URL}`,
endpoint: `GET /internal/observability_ai_assistant/connectors`,
});

expect(res.body.length).to.be(0);
Expand All @@ -72,7 +70,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});

const res = await observabilityAIAssistantAPIClient.slsEditor({
endpoint: `GET ${CONNECTOR_API_URL}`,
endpoint: `GET /internal/observability_ai_assistant/connectors`,
});

expect(res.body.length).to.be(1);
Expand All @@ -90,7 +88,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
it('should deny access for users without the ai_assistant privilege', async () => {
await observabilityAIAssistantAPIClient
.slsUnauthorized({
endpoint: `GET ${CONNECTOR_API_URL}`,
endpoint: `GET /internal/observability_ai_assistant/connectors`,
})
.expect(403);
});
Expand Down

0 comments on commit 6beb135

Please sign in to comment.