Skip to content

Commit 932aa83

Browse files
committed
fix: fix tests
1 parent 6fca8be commit 932aa83

File tree

2 files changed

+0
-80
lines changed

2 files changed

+0
-80
lines changed

projects/wc/src/app/components/generic-ui/detail-view/detail-view.component.spec.ts

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -138,55 +138,6 @@ describe('DetailViewComponent', () => {
138138
expect(mockAnchorElement.click).toHaveBeenCalled();
139139
});
140140

141-
it('should return default fields when ui.detailView.fields is undefined', () => {
142-
// Reset mocks and create new component instance
143-
jest.clearAllMocks();
144-
const newFixture = TestBed.createComponent(DetailViewComponent);
145-
const newComponent = newFixture.componentInstance;
146-
147-
newComponent.context = (() => ({
148-
resourceId: 'cluster-1',
149-
token: 'abc123',
150-
resourceDefinition: {
151-
kind: 'Cluster',
152-
group: 'core.k8s.io',
153-
ui: {
154-
detailView: {
155-
// fields is undefined
156-
},
157-
},
158-
},
159-
entity: {
160-
metadata: { name: 'test-resource' },
161-
},
162-
parentNavigationContexts: ['project'],
163-
})) as any;
164-
165-
newComponent.LuigiClient = (() => ({
166-
linkManager: () => ({
167-
fromContext: jest.fn().mockReturnThis(),
168-
navigate: jest.fn(),
169-
withParams: jest.fn().mockReturnThis(),
170-
}),
171-
uxManager: () => ({
172-
showAlert: jest.fn(),
173-
}),
174-
getNodeParams: jest.fn(),
175-
})) as any;
176-
177-
newFixture.detectChanges();
178-
179-
const defaultFields = [
180-
{
181-
label: 'Workspace Status',
182-
jsonPathExpression: 'status.conditions[?(@.type=="Ready")].status',
183-
property: ['status.conditions.status', 'status.conditions.type'],
184-
},
185-
];
186-
187-
expect(newComponent.resourceFields()).toEqual(defaultFields);
188-
});
189-
190141
it('should call resource service with correct parameters for account kind', () => {
191142
jest.clearAllMocks();
192143
const newFixture = TestBed.createComponent(DetailViewComponent);

projects/wc/src/app/components/generic-ui/list-view/list-view.component.spec.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -197,37 +197,6 @@ describe('ListViewComponent', () => {
197197
expect(newComponent.hasUiCreateViewFields()).toBe(true);
198198
});
199199

200-
it('should use default columns when no listView fields are defined', () => {
201-
// Create a new component instance with different context
202-
const newFixture = TestBed.createComponent(ListViewComponent);
203-
const newComponent = newFixture.componentInstance;
204-
205-
newComponent.context = (() => ({
206-
resourceDefinition: {
207-
plural: 'clusters',
208-
kind: 'Cluster',
209-
group: 'core.k8s.io',
210-
ui: {
211-
// No listView fields defined
212-
},
213-
},
214-
})) as any;
215-
216-
newComponent.LuigiClient = (() => ({
217-
linkManager: () => ({
218-
fromContext: jest.fn().mockReturnThis(),
219-
navigate: jest.fn(),
220-
withParams: jest.fn().mockReturnThis(),
221-
}),
222-
getNodeParams: jest.fn(),
223-
})) as any;
224-
225-
newFixture.detectChanges();
226-
227-
expect(newComponent.columns().length).toBeGreaterThan(0);
228-
expect(newComponent.columns()[0].label).toBe('Name');
229-
});
230-
231200
it('should compute heading correctly with capitalized plural', () => {
232201
const newFixture = TestBed.createComponent(ListViewComponent);
233202
const newComponent = newFixture.componentInstance;

0 commit comments

Comments
 (0)