1 parent
5f8bcf74a5
commit
e797954334
16 files changed
+273
-17
No files matched your search
@@ -48,7 +48,7 @@ import {
|
||||
type NacosConfigDeleteSnapshot,
|
||||
} from "@/lib/nacos/nacosAdmin";
|
||||
import { createNacosNamespaceRequestGuard, subscribeNacosNamespacesChanged, type NacosNamespacesChangedDetail } from "@/lib/nacos/nacosNamespaceCache";
|
||||
import { nacosInstanceMatchesPatch, nacosInstanceRefIdentity, nacosIpAddressIsValid, nacosServiceDetailMatches } from "@/lib/nacos/nacosServiceManagement";
|
||||
import { nacosInstanceMatchesPatch, nacosInstanceRefIdentity, nacosIpAddressIsValid, nacosServiceDetailMatches, nacosServiceInstanceHealthSummary } from "@/lib/nacos/nacosServiceManagement";
|
||||
import { loadReadableNacosNamespaces, nacosNamespaceIdentity } from "@/lib/nacos/nacosNamespaceVisibility";
|
||||
import { clipboardLineEndings, copyToClipboard, readTextFromClipboard } from "@/lib/common/clipboard";
|
||||
import { trimmedSelectionLayer } from "@/lib/editor/codemirrorTrimmedSelectionLayer";
|
||||
@@ -473,6 +473,12 @@ const canRequestBatchDeleteConfigs = computed(() => !props.readOnly && !savingCo
|
||||
const pendingBatchDeleteDetails = computed(() => pendingBatchDelete.value?.keys.map((key) => `namespace=${key.namespace || "public"}\ndataId=${key.dataId}\ngroup=${key.group || "DEFAULT_GROUP"}`).join("\n\n") || "");
|
||||
const pendingHistoryRollbackDetails = computed(() => (pendingHistoryRollback.value ? buildNacosConfigHistoryRollbackConfirm(pendingHistoryRollback.value, namespace.value) : ""));
|
||||
const pendingInstanceDetails = computed(() => (pendingInstanceUpdate.value && selectedService.value ? buildNacosInstanceConfirm(selectedService.value, pendingInstanceUpdate.value.instance, pendingInstanceUpdate.value.patch, serviceGroup.value, namespace.value) : ""));
|
||||
const pendingInstanceAvailabilityAction = computed(() => {
|
||||
const enabled = pendingInstanceUpdate.value?.patch.enabled;
|
||||
return enabled == null ? "" : t(enabled ? "nacos.online" : "nacos.offline");
|
||||
});
|
||||
const pendingInstanceTitle = computed(() => (pendingInstanceAvailabilityAction.value ? `${t("nacos.confirmInstanceTitle")}: ${pendingInstanceAvailabilityAction.value}` : t("nacos.confirmInstanceTitle")));
|
||||
const pendingInstanceConfirmLabel = computed(() => pendingInstanceAvailabilityAction.value || t("dangerDialog.confirm"));
|
||||
const pendingInstanceDeregisterDetails = computed(() => {
|
||||
if (!pendingInstanceDeregister.value || !selectedService.value) return "";
|
||||
const ref = instanceRef(pendingInstanceDeregister.value);
|
||||
@@ -2111,6 +2117,35 @@ function serviceIdentity(service: NacosServiceInfo | null) {
|
||||
return service ? `${service.groupName || "DEFAULT_GROUP"}\u0000${service.serviceName}` : "";
|
||||
}
|
||||
|
||||
function serviceInstanceHealthLabel(service: NacosServiceInfo) {
|
||||
const summary = nacosServiceInstanceHealthSummary(service);
|
||||
if (!summary) return "";
|
||||
const counts = { healthy: summary.healthy, total: summary.total };
|
||||
switch (summary.status) {
|
||||
case "allHealthy":
|
||||
return t("nacos.serviceInstancesAllHealthy", counts);
|
||||
case "partiallyHealthy":
|
||||
return t("nacos.serviceInstancesPartiallyHealthy", counts);
|
||||
case "noHealthyInstances":
|
||||
return t("nacos.serviceInstancesNoHealthyInstances", counts);
|
||||
case "noInstances":
|
||||
return t("nacos.serviceInstancesNoInstances");
|
||||
}
|
||||
}
|
||||
|
||||
function serviceInstanceHealthClass(service: NacosServiceInfo) {
|
||||
switch (nacosServiceInstanceHealthSummary(service)?.status) {
|
||||
case "allHealthy":
|
||||
return "border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300";
|
||||
case "partiallyHealthy":
|
||||
return "border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-300";
|
||||
case "noHealthyInstances":
|
||||
return "border-destructive/50 bg-destructive/10 text-destructive";
|
||||
default:
|
||||
return "border-muted-foreground/40 text-muted-foreground";
|
||||
}
|
||||
}
|
||||
|
||||
async function loadServiceDetail() {
|
||||
const service = selectedService.value ? { ...selectedService.value } : null;
|
||||
if (!service || !getServiceCapability.value.supported) return;
|
||||
@@ -2367,7 +2402,9 @@ async function reconcileInstancePresence(ref: NacosInstanceRef, shouldExist: boo
|
||||
async function updateInstance(instance: NacosInstanceInfo, patch: NacosInstancePatch) {
|
||||
if (!selectedService.value || props.readOnly || !supportsInstanceUpdate.value) return;
|
||||
const ref = instanceRef(instance);
|
||||
if (!(await confirmNacosMutation(t("nacos.confirmInstanceTitle"), props.connectionId, ref.namespace || namespace.value))) return;
|
||||
const availabilityAction = patch.enabled == null ? "" : t(patch.enabled ? "nacos.online" : "nacos.offline");
|
||||
const reviewText = availabilityAction ? `${t("nacos.confirmInstanceTitle")}: ${availabilityAction}` : t("nacos.confirmInstanceTitle");
|
||||
if (!(await confirmNacosMutation(reviewText, props.connectionId, ref.namespace || namespace.value))) return;
|
||||
const key = instanceIdentity(instance);
|
||||
const updateId = ++instanceUpdateSequence;
|
||||
const operationToken = beginInstanceOperation(key);
|
||||
@@ -3193,8 +3230,11 @@ useUpdateBlocker(() =>
|
||||
<span class="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
||||
<Server class="h-3.5 w-3.5" />
|
||||
{{ service.groupName || serviceGroup }}
|
||||
<span v-if="service.ipCount != null">· {{ t("nacos.instanceCount", { count: service.ipCount }) }}</span>
|
||||
<span v-if="service.healthyInstanceCount != null">· {{ t("nacos.healthy") }} {{ service.healthyInstanceCount }}</span>
|
||||
<Badge v-if="serviceInstanceHealthLabel(service)" data-testid="nacos-service-instance-status" variant="outline" class="h-5" :class="serviceInstanceHealthClass(service)">{{ serviceInstanceHealthLabel(service) }}</Badge>
|
||||
<template v-else>
|
||||
<span v-if="service.ipCount != null">· {{ t("nacos.instanceCount", { count: service.ipCount }) }}</span>
|
||||
<span v-if="service.healthyInstanceCount != null">· {{ t("nacos.healthy") }} {{ service.healthyInstanceCount }}</span>
|
||||
</template>
|
||||
<span v-if="service.clusterCount != null">· {{ t("nacos.cluster") }} {{ service.clusterCount }}</span>
|
||||
<Badge v-if="service.triggerFlag === 'true'" variant="outline" class="h-5 border-amber-500 text-amber-700">{{ t("nacos.protectionTriggered") }}</Badge>
|
||||
</span>
|
||||
@@ -3337,7 +3377,9 @@ useUpdateBlocker(() =>
|
||||
<span class="nacos-instance-address max-w-full font-mono text-sm font-medium">{{ instance.ip }}:{{ instance.port }}</span>
|
||||
<Badge variant="outline">{{ instance.clusterName || "DEFAULT" }}</Badge>
|
||||
<Badge variant="outline" :class="instance.healthy === false ? 'border-destructive/50 text-destructive' : 'border-emerald-500/50 text-emerald-700 dark:text-emerald-300'">{{ instance.healthy === false ? t("nacos.unhealthy") : t("nacos.healthy") }}</Badge>
|
||||
<Badge :variant="instance.enabled === false ? 'outline' : 'secondary'" :class="instance.enabled === false ? 'border-muted-foreground/50 text-muted-foreground' : ''">{{ instance.enabled === false ? t("nacos.offline") : t("nacos.enabled") }}</Badge>
|
||||
<Badge data-testid="nacos-instance-availability-status" :variant="instance.enabled === false ? 'outline' : 'secondary'" :class="instance.enabled === false ? 'border-muted-foreground/50 text-muted-foreground' : ''">{{
|
||||
instance.enabled === false ? t("nacos.offline") : t("nacos.online")
|
||||
}}</Badge>
|
||||
<Badge v-if="instance.ephemeral != null" variant="outline">{{ instance.ephemeral ? t("nacos.ephemeral") : t("nacos.persistent") }}</Badge>
|
||||
</div>
|
||||
<div class="nacos-instance-detail-grid mt-3 grid gap-x-5 gap-y-3 text-xs">
|
||||
@@ -3380,12 +3422,13 @@ useUpdateBlocker(() =>
|
||||
size="sm"
|
||||
variant="outline"
|
||||
class="h-7 gap-1"
|
||||
data-testid="nacos-instance-availability-action"
|
||||
:class="instance.enabled === false ? 'border-emerald-500/50 text-emerald-700 hover:bg-emerald-500/10 hover:text-emerald-800 dark:text-emerald-300 dark:hover:text-emerald-200' : 'border-destructive/50 text-destructive hover:bg-destructive/10'"
|
||||
:disabled="readOnly || !supportsInstanceUpdate || isInstanceUpdating(instance)"
|
||||
@click="requestUpdateInstance(instance, { enabled: !instance.enabled })"
|
||||
>
|
||||
<Loader2 v-if="isInstanceUpdating(instance)" class="h-3 w-3 animate-spin" />
|
||||
{{ instance.enabled === false ? t("nacos.enable") : t("nacos.disable") }}
|
||||
{{ instance.enabled === false ? t("nacos.online") : t("nacos.offline") }}
|
||||
</Button>
|
||||
<Button v-if="updateInstanceHealthCapability.supported" size="sm" variant="outline" class="h-7" :disabled="readOnly || isInstanceUpdating(instance)" @click="requestUpdateInstance(instance, { healthy: !instance.healthy })">
|
||||
{{ instance.healthy === false ? t("nacos.markHealthy") : t("nacos.markUnhealthy") }}
|
||||
@@ -3711,10 +3754,10 @@ useUpdateBlocker(() =>
|
||||
|
||||
<DangerConfirmDialog
|
||||
:open="!!pendingInstanceUpdate"
|
||||
:title="t('nacos.confirmInstanceTitle')"
|
||||
:title="pendingInstanceTitle"
|
||||
:message="t('nacos.confirmInstanceMessage')"
|
||||
:details="pendingInstanceDetails"
|
||||
:confirm-label="t('dangerDialog.confirm')"
|
||||
:confirm-label="pendingInstanceConfirmLabel"
|
||||
:loading="pendingInstanceUpdate ? isInstanceUpdating(pendingInstanceUpdate.instance) : false"
|
||||
:close-on-confirm="false"
|
||||
@update:open="
|
||||
|
||||
+130
-4
@@ -2,15 +2,19 @@
|
||||
|
||||
import { createApp, defineComponent, h, KeepAlive, nextTick, ref, type App, type ComponentPublicInstance } from "vue";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { NacosConfigItem, NacosConfigKey, NacosConfigList } from "@/types/nacos";
|
||||
import type { NacosConfigItem, NacosConfigKey, NacosConfigList, NacosInstanceInfo, NacosServiceInfo } from "@/types/nacos";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
ensureConnected: vi.fn(),
|
||||
nacosDeleteConfig: vi.fn(),
|
||||
nacosGetConfig: vi.fn(),
|
||||
nacosGetService: vi.fn(),
|
||||
nacosListInstances: vi.fn(),
|
||||
nacosListConfigs: vi.fn(),
|
||||
nacosListServices: vi.fn(),
|
||||
nacosTestConnection: vi.fn(),
|
||||
nacosUpdateInstance: vi.fn(),
|
||||
confirmNacosMutation: vi.fn(),
|
||||
queryTabs: [] as Array<Record<string, unknown>>,
|
||||
updateNacosConfigEditorViewport: vi.fn(),
|
||||
toast: vi.fn(),
|
||||
@@ -18,15 +22,32 @@ const mocks = vi.hoisted(() => ({
|
||||
|
||||
vi.mock("vue-i18n", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("vue-i18n")>()),
|
||||
useI18n: () => ({ t: (key: string) => key }),
|
||||
useI18n: () => ({
|
||||
t: (key: string, params?: Record<string, unknown>) => {
|
||||
const template =
|
||||
{
|
||||
"nacos.confirmInstanceTitle": "Update Nacos instance",
|
||||
"nacos.offline": "Offline",
|
||||
"nacos.online": "Online",
|
||||
"nacos.serviceInstancesAllHealthy": "All healthy · {healthy}/{total}",
|
||||
"nacos.serviceInstancesPartiallyHealthy": "Partially healthy · {healthy}/{total}",
|
||||
"nacos.serviceInstancesNoHealthyInstances": "No healthy instances · {healthy}/{total}",
|
||||
"nacos.serviceInstancesNoInstances": "No instances",
|
||||
}[key] ?? key;
|
||||
return Object.entries(params ?? {}).reduce((message, [name, value]) => message.replaceAll(`{${name}}`, String(value)), template);
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/backend/api", () => ({
|
||||
nacosDeleteConfig: mocks.nacosDeleteConfig,
|
||||
nacosGetConfig: mocks.nacosGetConfig,
|
||||
nacosGetService: mocks.nacosGetService,
|
||||
nacosListInstances: mocks.nacosListInstances,
|
||||
nacosListConfigs: mocks.nacosListConfigs,
|
||||
nacosListServices: mocks.nacosListServices,
|
||||
nacosTestConnection: mocks.nacosTestConnection,
|
||||
nacosUpdateInstance: mocks.nacosUpdateInstance,
|
||||
}));
|
||||
|
||||
vi.mock("@/stores/connectionStore", () => ({
|
||||
@@ -68,7 +89,7 @@ vi.mock("@/composables/useTheme", async () => {
|
||||
vi.mock("@/composables/useToast", () => ({ useToast: () => ({ toast: mocks.toast }) }));
|
||||
|
||||
vi.mock("@/lib/database/productionExecutionGuard", () => ({
|
||||
executeWithProductionContextGuard: ({ execute }: { execute: () => Promise<unknown> }) => execute(),
|
||||
executeWithProductionContextGuard: mocks.confirmNacosMutation,
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/database/productionSafety", () => ({
|
||||
@@ -101,7 +122,35 @@ vi.mock("@/components/ui/select", async () => {
|
||||
});
|
||||
|
||||
vi.mock("@/components/common/ProductionContextBadge.vue", async () => ({ default: (await import("@/components/grid/__tests__/vueHostHarness")).createPassthroughStub("ProductionContextBadge") }));
|
||||
vi.mock("@/components/editor/DangerConfirmDialog.vue", async () => ({ default: (await import("@/components/grid/__tests__/vueHostHarness")).createPassthroughStub("DangerConfirmDialog") }));
|
||||
vi.mock("@/components/editor/DangerConfirmDialog.vue", async () => {
|
||||
const { defineComponent, h } = await import("vue");
|
||||
return {
|
||||
default: defineComponent({
|
||||
props: {
|
||||
open: Boolean,
|
||||
title: String,
|
||||
message: String,
|
||||
confirmLabel: String,
|
||||
},
|
||||
emits: ["confirm", "update:open"],
|
||||
setup(props, { emit }) {
|
||||
return () =>
|
||||
props.open
|
||||
? h(
|
||||
"button",
|
||||
{
|
||||
"data-testid": "nacos-instance-update-confirm",
|
||||
"data-title": props.title,
|
||||
"data-message": props.message,
|
||||
onClick: () => emit("confirm"),
|
||||
},
|
||||
props.confirmLabel,
|
||||
)
|
||||
: null;
|
||||
},
|
||||
}),
|
||||
};
|
||||
});
|
||||
vi.mock("@/components/editor/EditorSearchPanel.vue", async () => ({ default: (await import("@/components/grid/__tests__/vueHostHarness")).createPassthroughStub("EditorSearchPanel") }));
|
||||
vi.mock("@/components/nacos/NacosConfigDiffDialog.vue", async () => ({ default: (await import("@/components/grid/__tests__/vueHostHarness")).createPassthroughStub("NacosConfigDiffDialog") }));
|
||||
vi.mock("@/components/nacos/NacosConfigHistoryDialog.vue", async () => ({ default: (await import("@/components/grid/__tests__/vueHostHarness")).createPassthroughStub("NacosConfigHistoryDialog") }));
|
||||
@@ -117,11 +166,13 @@ vi.mock("splitpanes", async () => {
|
||||
import NacosAdminConsole from "@/components/nacos/NacosAdminConsole.vue";
|
||||
|
||||
type NacosAdminSetupState = {
|
||||
activeTab: "configs" | "services";
|
||||
configGroup: string;
|
||||
configPageNo: number;
|
||||
configPageSize: number;
|
||||
configEditorView: { scrollDOM: HTMLElement } | null;
|
||||
configs: NacosConfigItem[];
|
||||
instances: NacosInstanceInfo[];
|
||||
deleteConfig: () => Promise<void>;
|
||||
deleteSelectedConfigs: () => Promise<void>;
|
||||
requestBatchDeleteConfigs: () => void;
|
||||
@@ -129,6 +180,8 @@ type NacosAdminSetupState = {
|
||||
selectedConfig: NacosConfigItem | null;
|
||||
selectedConfigKeys: string[];
|
||||
selectedConfigOriginalKey: NacosConfigKey | null;
|
||||
selectedService: NacosServiceInfo | null;
|
||||
services: NacosServiceInfo[];
|
||||
selectConfig: (item: NacosConfigItem) => Promise<void>;
|
||||
toggleConfigSelection: (item: NacosConfigItem, checked: boolean) => void;
|
||||
};
|
||||
@@ -160,6 +213,8 @@ beforeEach(async () => {
|
||||
mocks.ensureConnected.mockReset().mockResolvedValue(undefined);
|
||||
mocks.nacosDeleteConfig.mockReset().mockResolvedValue(undefined);
|
||||
mocks.nacosGetConfig.mockReset().mockResolvedValue(configA);
|
||||
mocks.nacosGetService.mockReset().mockResolvedValue({ serviceName: "api", groupName: "DEFAULT_GROUP" });
|
||||
mocks.nacosListInstances.mockReset().mockResolvedValue([]);
|
||||
mocks.nacosListConfigs.mockReset().mockResolvedValue(configList(1, 20, 2, [configA, configB]));
|
||||
mocks.nacosListServices.mockReset().mockResolvedValue({ pageNo: 1, pageSize: 20, totalCount: 0, items: [] });
|
||||
mocks.nacosTestConnection.mockReset().mockResolvedValue({
|
||||
@@ -169,6 +224,8 @@ beforeEach(async () => {
|
||||
auth: "none",
|
||||
capabilities: { supportsConfigManagement: true, supportsConfigHistory: true, supportsServiceManagement: true, supportsInstanceUpdate: true, supportsRawApi: true },
|
||||
});
|
||||
mocks.nacosUpdateInstance.mockReset().mockResolvedValue(undefined);
|
||||
mocks.confirmNacosMutation.mockReset().mockImplementation(({ execute }: { execute: () => Promise<unknown> }) => execute());
|
||||
mocks.toast.mockReset();
|
||||
mocks.updateNacosConfigEditorViewport.mockReset();
|
||||
mocks.queryTabs.splice(0);
|
||||
@@ -232,6 +289,75 @@ describe("NacosAdminConsole config deletion", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("NacosAdminConsole service instance status", () => {
|
||||
it("renders accessible text for every service health-count state", async () => {
|
||||
state.activeTab = "services";
|
||||
state.services = [
|
||||
{ serviceName: "all-healthy", ipCount: 3, healthyInstanceCount: 3 },
|
||||
{ serviceName: "partially-healthy", ipCount: 3, healthyInstanceCount: 2 },
|
||||
{ serviceName: "no-healthy", ipCount: 3, healthyInstanceCount: 0 },
|
||||
{ serviceName: "no-instances", ipCount: 0, healthyInstanceCount: 0 },
|
||||
];
|
||||
await flushUi();
|
||||
|
||||
const statuses = Array.from(host!.querySelectorAll<HTMLElement>("[data-testid=nacos-service-instance-status]"));
|
||||
expect(statuses.map((status) => status.textContent?.trim())).toEqual(["All healthy · 3/3", "Partially healthy · 2/3", "No healthy instances · 0/3", "No instances"]);
|
||||
expect(statuses.map((status) => status.className)).toEqual([expect.stringContaining("text-emerald-700"), expect.stringContaining("text-amber-700"), expect.stringContaining("text-destructive"), expect.stringContaining("text-muted-foreground")]);
|
||||
});
|
||||
|
||||
it("uses Online and Offline in actions and confirmations without changing the enabled patch", async () => {
|
||||
const service: NacosServiceInfo = { serviceName: "api", groupName: "DEFAULT_GROUP", ipCount: 1, healthyInstanceCount: 1 };
|
||||
let currentInstance: NacosInstanceInfo = { ip: "127.0.0.1", port: 8080, clusterName: "DEFAULT", groupName: "DEFAULT_GROUP", enabled: true, healthy: true };
|
||||
mocks.nacosUpdateInstance.mockImplementation(async (_connectionId, request) => {
|
||||
currentInstance = { ...currentInstance, ...request.patch };
|
||||
});
|
||||
mocks.nacosListInstances.mockImplementation(async () => [currentInstance]);
|
||||
state.activeTab = "services";
|
||||
state.selectedService = service;
|
||||
state.instances = [currentInstance];
|
||||
await flushUi();
|
||||
|
||||
expect(host!.querySelector("[data-testid=nacos-instance-availability-status]")?.textContent?.trim()).toBe("Online");
|
||||
let action = host!.querySelector<HTMLButtonElement>("[data-testid=nacos-instance-availability-action]");
|
||||
expect(action?.textContent?.trim()).toBe("Offline");
|
||||
action?.click();
|
||||
await flushUi();
|
||||
|
||||
let confirm = host!.querySelector<HTMLButtonElement>("[data-testid=nacos-instance-update-confirm]");
|
||||
expect(confirm?.textContent?.trim()).toBe("Offline");
|
||||
expect(confirm?.getAttribute("data-title")).toBe("Update Nacos instance: Offline");
|
||||
confirm?.click();
|
||||
await vi.waitFor(() => expect(mocks.nacosUpdateInstance).toHaveBeenCalledTimes(1));
|
||||
expect(mocks.nacosUpdateInstance).toHaveBeenNthCalledWith(1, "connection-1", {
|
||||
target: {
|
||||
namespace: "public",
|
||||
serviceName: "api",
|
||||
groupName: "DEFAULT_GROUP",
|
||||
ip: "127.0.0.1",
|
||||
port: 8080,
|
||||
clusterName: "DEFAULT",
|
||||
ephemeral: undefined,
|
||||
},
|
||||
patch: { enabled: false },
|
||||
});
|
||||
expect(mocks.confirmNacosMutation).toHaveBeenNthCalledWith(1, expect.objectContaining({ reviewText: "Update Nacos instance: Offline" }));
|
||||
await flushUi();
|
||||
|
||||
expect(host!.querySelector("[data-testid=nacos-instance-availability-status]")?.textContent?.trim()).toBe("Offline");
|
||||
action = host!.querySelector<HTMLButtonElement>("[data-testid=nacos-instance-availability-action]");
|
||||
expect(action?.textContent?.trim()).toBe("Online");
|
||||
action?.click();
|
||||
await flushUi();
|
||||
confirm = host!.querySelector<HTMLButtonElement>("[data-testid=nacos-instance-update-confirm]");
|
||||
expect(confirm?.textContent?.trim()).toBe("Online");
|
||||
expect(confirm?.getAttribute("data-title")).toBe("Update Nacos instance: Online");
|
||||
confirm?.click();
|
||||
await vi.waitFor(() => expect(mocks.nacosUpdateInstance).toHaveBeenCalledTimes(2));
|
||||
expect(mocks.nacosUpdateInstance.mock.calls[1]?.[1]).toEqual(expect.objectContaining({ patch: { enabled: true } }));
|
||||
expect(mocks.confirmNacosMutation).toHaveBeenNthCalledWith(2, expect.objectContaining({ reviewText: "Update Nacos instance: Online" }));
|
||||
});
|
||||
});
|
||||
|
||||
describe("NacosAdminConsole cached tab restoration", () => {
|
||||
it("does not let a hidden editor overwrite its viewport before reactivation", async () => {
|
||||
app?.unmount();
|
||||
|
||||
Reference in new issue
Block a user