test: implement unit tests for hooks and refactor some types (#493)

This commit is contained in:
Fine0830
2025-08-21 12:09:32 +07:00
committed by GitHub
parent a8c5ec8dd2
commit 1b6f011f0e
25 changed files with 3140 additions and 285 deletions

View File

@@ -91,6 +91,7 @@ limitations under the License. -->
import getDashboard from "@/hooks/useDashboardsSession";
import type { MetricConfigOpt } from "@/types/dashboard";
import ColumnGraph from "./components/ColumnGraph.vue";
import type { PodWithMetrics } from "@/hooks/useExpressionsProcessor";
/*global defineProps */
const props = defineProps({
@@ -176,11 +177,11 @@ limitations under the License. -->
if (expressions.length && expressions[0]) {
const params = await useExpressionsQueryPodsMetrics(
currentInstances,
currentInstances as PodWithMetrics[],
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
EntityType[3].value,
);
instances.value = params.data;
instances.value = params.data as Instance[];
colMetrics.value = params.names;
colSubMetrics.value = params.subNames;
typesOfMQE.value = params.metricTypesArr;