From ed525bea20a7ae6d04fa0b26d82cdd4ec699703c Mon Sep 17 00:00:00 2001 From: Viduni Wickramarachchi Date: Fri, 27 Dec 2024 10:10:34 -0500 Subject: [PATCH] [Obs AI Assistant] Add route privilege tests for serverless (#204884) --- .../tests/conversations/conversations.spec.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/conversations/conversations.spec.ts b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/conversations/conversations.spec.ts index e4aa90993bd3b..88c386cbbdb27 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/conversations/conversations.spec.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/conversations/conversations.spec.ts @@ -296,9 +296,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { }, }, }); - // throw new ForbiddenApiError( - // 'Expected slsUnauthorized() to throw a 403 Forbidden error' - // ); + throw new ForbiddenApiError( + 'Expected slsUnauthorized() to throw a 403 Forbidden error' + ); } catch (e) { expect(e.status).to.be(403); } @@ -309,9 +309,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { await observabilityAIAssistantAPIClient.slsUnauthorized({ endpoint: 'POST /internal/observability_ai_assistant/conversations', }); - // throw new ForbiddenApiError( - // 'Expected slsUnauthorized() to throw a 403 Forbidden error' - // ); + throw new ForbiddenApiError( + 'Expected slsUnauthorized() to throw a 403 Forbidden error' + ); } catch (e) { expect(e.status).to.be(403); } @@ -332,9 +332,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { }, }, }); - // throw new ForbiddenApiError( - // 'Expected slsUnauthorized() to throw a 403 Forbidden error' - // ); + throw new ForbiddenApiError( + 'Expected slsUnauthorized() to throw a 403 Forbidden error' + ); } catch (e) { expect(e.status).to.be(403); } @@ -350,9 +350,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { }, }, }); - // throw new ForbiddenApiError( - // 'Expected slsUnauthorized() to throw a 403 Forbidden error' - // ); + throw new ForbiddenApiError( + 'Expected slsUnauthorized() to throw a 403 Forbidden error' + ); } catch (e) { expect(e.status).to.be(403); }