Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Commit dbb40a7

Browse files
claude[bot]claude
andauthored
test(vi-mock): inherit the real @object-ui/plugin-grid surface in 25 vi.mock factories (#8146)
Sweeps objectui#6892's seventh specifier. All 25 judged call sites on `@object-ui/plugin-grid` were frozen -- 21 under packages/plugin-view, 4 under packages/plugin-designer -- and each now obtains the real barrel through `importOriginal` and spreads it FIRST, keeping its hand-written overrides after. The specifier joins COVERED_SPECIFIERS in the same commit, so the guard holds it at zero from here. Two syntactic shapes: 21 object-literal arrows (15 of them byte-identical on one line) and 4 designer sites that delegated the whole factory to a shared manual mock module, which now spread the real barrel first and the manual mock second. STEP 0 walked the 560-module, 1421-statement graph reachable from the barrel and returned PROCEED on the CLASS of the effect: 114 namespaced module-scope ComponentRegistry.register calls plus three registration idioms in packages/fields (registerFieldRenderer, setCellRendererResolver, registerAllFields), all Map.set or a module-level let; zero timers, globals, storage, fetch or connections. Importing the real barrel under happy-dom registers 375 keys and emits zero console.warn and zero console.error. The pin's neighbour fixture named this specifier while it was uncovered, so the sweep turned its frozen factory into a genuine finding. It now names a specifier no package publishes, which keeps the case about the scope resolver rather than about the covered set's current membership. Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr Co-authored-by: Claude <noreply@anthropic.com>
1 parent c14d3a0 commit dbb40a7

28 files changed

Lines changed: 189 additions & 32 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
---
3+
4+
Test-only change: the 25 `vi.mock` factories that hand-listed `@object-ui/plugin-grid`'s
5+
exports now inherit the real barrel's export surface, and the specifier joins the
6+
`check-vi-mock-inherit` guard's covered set. No published behaviour changes.

‎packages/plugin-designer/src/__tests__/DashboardEditor.rootTitleRetired.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ import { render, screen, fireEvent, cleanup, within } from '@testing-library/rea
3232
import type { DashboardComponentSchema } from '@object-ui/types';
3333
import { DashboardEditor } from '../DashboardEditor';
3434

35-
vi.mock('@object-ui/plugin-grid', () => import('./__mocks__/plugin-grid'));
35+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
36+
...(await importOriginal<Record<string, unknown>>()),
37+
...(await import('./__mocks__/plugin-grid')),
38+
}));
3639
vi.mock('@object-ui/plugin-form', async (importOriginal) => ({
3740
...(await importOriginal<Record<string, unknown>>()),
3841
...(await import('./__mocks__/plugin-form')),

‎packages/plugin-designer/src/__tests__/FieldDesigner.formulaControlRetired.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ import { render, screen, fireEvent, waitFor, cleanup } from '@testing-library/re
5555
import type { DesignerFieldDefinition } from '@object-ui/types';
5656
import { FieldDesigner } from '../FieldDesigner';
5757

58-
vi.mock('@object-ui/plugin-grid', () => import('./__mocks__/plugin-grid'));
58+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
59+
...(await importOriginal<Record<string, unknown>>()),
60+
...(await import('./__mocks__/plugin-grid')),
61+
}));
5962
vi.mock('@object-ui/plugin-form', async (importOriginal) => ({
6063
...(await importOriginal<Record<string, unknown>>()),
6164
...(await import('./__mocks__/plugin-form')),

‎packages/plugin-designer/src/__tests__/ObjectManager.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import { ObjectManager } from '../ObjectManager';
1212
import type { ObjectDefinition } from '@object-ui/types';
1313

1414
// Mock standard components — tested separately in their own packages
15-
vi.mock('@object-ui/plugin-grid', () => import('./__mocks__/plugin-grid'));
15+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
16+
...(await importOriginal<Record<string, unknown>>()),
17+
...(await import('./__mocks__/plugin-grid')),
18+
}));
1619
vi.mock('@object-ui/plugin-form', async (importOriginal) => ({
1720
...(await importOriginal<Record<string, unknown>>()),
1821
...(await import('./__mocks__/plugin-form')),

‎packages/plugin-designer/src/__tests__/bareKeysNoProviderFallback.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ import type { DashboardComponentSchema, ObjectDefinition } from '@object-ui/type
5252
import { DashboardEditor } from '../DashboardEditor';
5353
import { ObjectManager } from '../ObjectManager';
5454

55-
vi.mock('@object-ui/plugin-grid', () => import('./__mocks__/plugin-grid'));
55+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
56+
...(await importOriginal<Record<string, unknown>>()),
57+
...(await import('./__mocks__/plugin-grid')),
58+
}));
5659
vi.mock('@object-ui/plugin-form', async (importOriginal) => ({
5760
...(await importOriginal<Record<string, unknown>>()),
5861
...(await import('./__mocks__/plugin-form')),

‎packages/plugin-view/src/__tests__/ObjectView.calendarBinding-7029.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ vi.mock('@object-ui/react', async (importOriginal) => {
5151
notifyDataChanged: () => {},
5252
};
5353
});
54-
vi.mock('@object-ui/plugin-grid', () => ({ ObjectGrid: () => <div data-testid="object-grid" /> }));
54+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
55+
...(await importOriginal<Record<string, unknown>>()),
56+
ObjectGrid: () => <div data-testid="object-grid" />,
57+
}));
5558
vi.mock('@object-ui/plugin-form', async (importOriginal) => ({
5659
...(await importOriginal<Record<string, unknown>>()),
5760
ObjectForm: () => <div data-testid="object-form" />,

‎packages/plugin-view/src/__tests__/ObjectView.canonicalTableKeys.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ vi.mock('@object-ui/react', async (importOriginal) => {
6868
* it was handed. What reaches this object IS the forwarding whitelist.
6969
*/
7070
const gridSchemas: any[] = [];
71-
vi.mock('@object-ui/plugin-grid', () => ({
71+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
72+
...(await importOriginal<Record<string, unknown>>()),
7273
ObjectGrid: ({ schema }: any) => {
7374
gridSchemas.push(schema);
7475
return <div data-testid="object-grid" />;

‎packages/plugin-view/src/__tests__/ObjectView.contractEnvelope-6726.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ vi.mock('@object-ui/react', async (importOriginal) => {
6060
notifyDataChanged: () => {},
6161
};
6262
});
63-
vi.mock('@object-ui/plugin-grid', () => ({ ObjectGrid: () => <div data-testid="object-grid" /> }));
63+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
64+
...(await importOriginal<Record<string, unknown>>()),
65+
ObjectGrid: () => <div data-testid="object-grid" />,
66+
}));
6467
vi.mock('@object-ui/plugin-form', async (importOriginal) => ({
6568
...(await importOriginal<Record<string, unknown>>()),
6669
ObjectForm: () => <div data-testid="object-form" />,

‎packages/plugin-view/src/__tests__/ObjectView.contractEnvelope-6840.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ vi.mock('@object-ui/react', async (importOriginal) => {
8989
notifyDataChanged: () => {},
9090
};
9191
});
92-
vi.mock('@object-ui/plugin-grid', () => ({ ObjectGrid: () => <div data-testid="object-grid" /> }));
92+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
93+
...(await importOriginal<Record<string, unknown>>()),
94+
ObjectGrid: () => <div data-testid="object-grid" />,
95+
}));
9396
vi.mock('@object-ui/plugin-form', async (importOriginal) => ({
9497
...(await importOriginal<Record<string, unknown>>()),
9598
ObjectForm: () => <div data-testid="object-form" />,

‎packages/plugin-view/src/__tests__/ObjectView.dataSourceContextFallback-7842.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ vi.mock('@object-ui/react', async (importOriginal) => ({
7070
),
7171
}));
7272

73-
vi.mock('@object-ui/plugin-grid', () => ({
73+
vi.mock('@object-ui/plugin-grid', async (importOriginal) => ({
74+
...(await importOriginal<Record<string, unknown>>()),
7475
ObjectGrid: ({ schema }: { schema?: { objectName?: string } }) => (
7576
<div data-testid="object-grid" data-object={schema?.objectName} />
7677
),

0 commit comments

Comments
 (0)