From 972c2206c5143b37c21c4cae45a72e95b879f91f Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:45:48 -0700 Subject: [PATCH] Update getDetectors URL to match recent API changes (#1257) (#1259) This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/pull/739. Previously, the tests in `dashboard_spec.js` and `detector_list_spec.js` were failing because they were waiting for requests to `BASE_AD_NODE_API_PATH + '/detectors*'`, which no longer exists due to the URL update. Testing: - Successfully ran all tests in `dashboard_spec.js` and `detector_list_spec.js` to ensure that they now correctly interact with the updated URL. Signed-off-by: Kaituo Li (cherry picked from commit c4c515d3c679a2e01fb3ae0cff63dece70b16290) Co-authored-by: Kaituo Li --- .../plugins/anomaly-detection-dashboards-plugin/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/utils/plugins/anomaly-detection-dashboards-plugin/constants.js b/cypress/utils/plugins/anomaly-detection-dashboards-plugin/constants.js index e6f3cbc74..bbda3c543 100644 --- a/cypress/utils/plugins/anomaly-detection-dashboards-plugin/constants.js +++ b/cypress/utils/plugins/anomaly-detection-dashboards-plugin/constants.js @@ -45,7 +45,7 @@ export function getADStopDetectorApiPath(detectorId) { const BASE_AD_NODE_API_PATH = BASE_PATH + '/api/anomaly_detectors'; export const AD_NODE_API_PATH = { - GET_DETECTORS: BASE_AD_NODE_API_PATH + '/detectors*', + GET_DETECTORS: BASE_AD_NODE_API_PATH + '/detectors/_list*', GET_INDICES: BASE_AD_NODE_API_PATH + '/_indices*', GET_MAPPINGS: BASE_AD_NODE_API_PATH + '/_mappings*', VALIDATE: BASE_AD_NODE_API_PATH + '/detectors/_validate',