diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/features/property-editor/components/PropertyEditorTab.test.tsx b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/features/property-editor/components/PropertyEditorTab.test.tsx
index cb239d1680370..e1f85519e7e72 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/features/property-editor/components/PropertyEditorTab.test.tsx
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/features/property-editor/components/PropertyEditorTab.test.tsx
@@ -22,11 +22,28 @@ import userEvent from '@testing-library/user-event';
import { vi } from 'vitest';
import { PropertyEditorTab } from './PropertyEditorTab';
import { usePropertyEditor } from '~/features/property-editor/hooks/usePropertyEditor';
+import { useSchedulerStore } from '~/stores/schedulerStore';
import type { QueueInfo, PropertyDescriptor } from '~/types';
// Mock the hooks
vi.mock('~/features/property-editor/hooks/usePropertyEditor');
+// Mock the scheduler store
+vi.mock('~/stores/schedulerStore', () => ({
+ useSchedulerStore: vi.fn((selector: any) => {
+ const state = {
+ getGlobalPropertyValue: vi.fn().mockReturnValue({ value: '' }),
+ getQueuePropertyValue: vi.fn().mockReturnValue({ value: '' }),
+ stagedChanges: [],
+ configData: new Map(),
+ schedulerData: null,
+ hasPendingDeletion: vi.fn().mockReturnValue(false),
+ revertQueueDeletion: vi.fn(),
+ };
+ return selector ? selector(state) : state;
+ }),
+}));
+
// Mock toast
vi.mock('sonner', () => ({
toast: {
@@ -161,6 +178,28 @@ describe('PropertyEditorTab', () => {
expect(within(capacityTrigger).getByText('1')).toBeInTheDocument();
});
+ describe('pending deletion state', () => {
+ it('should not show deletion banner in PropertyEditorTab (banner is in PropertyPanel)', () => {
+ vi.mocked(useSchedulerStore).mockImplementation((selector: any) => {
+ const state = {
+ getGlobalPropertyValue: vi.fn().mockReturnValue({ value: '' }),
+ getQueuePropertyValue: vi.fn().mockReturnValue({ value: '' }),
+ stagedChanges: [],
+ configData: new Map(),
+ schedulerData: null,
+ hasPendingDeletion: vi.fn().mockReturnValue(true),
+ revertQueueDeletion: vi.fn(),
+ };
+ return selector ? selector(state) : state;
+ });
+
+ render(