Skip to content

Commit 2d0024f

Browse files
Copilothotlong
andcommitted
fix: remove unused variables in SpecViewConfig.test.tsx to fix TS6133 errors
The capturedKanbanSchema and capturedCalendarSchema variables were assigned in mock callbacks but never read in assertions. The unused props parameter in ObjectGrid mock was also prefixed with underscore. These caused TypeScript noUnusedLocals/noUnusedParameters errors that broke the console build in CI. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent c9a8bc1 commit 2d0024f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

apps/console/src/__tests__/SpecViewConfig.test.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,19 @@ import { ComponentRegistry } from '@object-ui/core';
1414
*/
1515

1616
// Mock child plugins to capture schema props
17-
let capturedKanbanSchema: any = null;
18-
let capturedCalendarSchema: any = null;
1917

2018
vi.mock('@object-ui/plugin-grid', () => ({
21-
ObjectGrid: (props: any) => <div data-testid="object-grid">Grid</div>,
19+
ObjectGrid: (_props: any) => <div data-testid="object-grid">Grid</div>,
2220
}));
2321

2422
vi.mock('@object-ui/plugin-kanban', () => ({
2523
ObjectKanban: (props: any) => {
26-
capturedKanbanSchema = props.schema;
2724
return <div data-testid="object-kanban">Kanban: {props.schema.groupField}</div>;
2825
},
2926
}));
3027

3128
vi.mock('@object-ui/plugin-calendar', () => ({
3229
ObjectCalendar: (props: any) => {
33-
capturedCalendarSchema = props.schema;
3430
return <div data-testid="object-calendar">Calendar: {props.schema.startDateField}</div>;
3531
},
3632
}));
@@ -65,17 +61,13 @@ describe('Spec Protocol: Nested View Config Enforcement', () => {
6561

6662
beforeEach(() => {
6763
vi.clearAllMocks();
68-
capturedKanbanSchema = null;
69-
capturedCalendarSchema = null;
7064
mockSearchParams = new URLSearchParams();
7165

72-
ComponentRegistry.register('object-grid', (props: any) => <div data-testid="object-grid">Grid</div>);
66+
ComponentRegistry.register('object-grid', (_props: any) => <div data-testid="object-grid">Grid</div>);
7367
ComponentRegistry.register('object-kanban', (props: any) => {
74-
capturedKanbanSchema = props.schema;
7568
return <div data-testid="object-kanban">Kanban: {props.schema.groupField}</div>;
7669
});
7770
ComponentRegistry.register('object-calendar', (props: any) => {
78-
capturedCalendarSchema = props.schema;
7971
return <div data-testid="object-calendar">Calendar: {props.schema.startDateField}</div>;
8072
});
8173
ComponentRegistry.register('list-view', (_props: any) => <div data-testid="list-view">List View</div>);

0 commit comments

Comments
 (0)