File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,22 +19,6 @@ import { PageView } from './components/PageView';
1919import { ReportView } from './components/ReportView' ;
2020import { ExpressionProvider } from './context/ExpressionProvider' ;
2121
22- /**
23- * Patch: MSW discovery response uses 'routes' instead of 'endpoints'.
24- * This normalizes the shape until @objectstack/plugin-msw is fixed upstream.
25- */
26- function patchDiscoveryEndpoints ( adapter : ObjectStackAdapter ) {
27- try {
28- const client = adapter . getClient ( ) ;
29- const info = ( client as any ) . discoveryInfo ;
30- if ( info ?. routes && ! info . endpoints ) {
31- info . endpoints = info . routes ;
32- }
33- } catch {
34- // Silently ignore — adapter may not expose getClient()
35- }
36- }
37-
3822import { useParams } from 'react-router-dom' ;
3923import { ThemeProvider } from './components/theme-provider' ;
4024
@@ -83,10 +67,6 @@ export function AppContent() {
8367
8468 await adapter . connect ( ) ;
8569
86- // Patch: MSW discovery returns 'routes' instead of 'endpoints'.
87- // TODO: Fix in @objectstack /plugin-msw to emit correct discovery shape.
88- patchDiscoveryEndpoints ( adapter ) ;
89-
9070 setDataSource ( adapter ) ;
9171 } catch ( err ) {
9272 console . error ( '[Console] Failed to initialize:' , err ) ;
Original file line number Diff line number Diff line change @@ -487,8 +487,8 @@ describe('ObjectForm with MSW Integration', () => {
487487
488488 // Verify data is persisted by fetching it
489489 const result = await client . data . get ( 'contact' , createdId ) ;
490- expect ( result . name ) . toBe ( 'Persist Test' ) ;
491- expect ( result . email ) . toBe ( 'persist@example.com' ) ;
490+ expect ( result . record . name ) . toBe ( 'Persist Test' ) ;
491+ expect ( result . record . email ) . toBe ( 'persist@example.com' ) ;
492492 } ) ;
493493 } ) ;
494494} ) ;
Original file line number Diff line number Diff line change @@ -57,18 +57,7 @@ export async function startMockServer() {
5757 logRequests : true
5858 } ) ;
5959
60- // WORKAROUND: ObjectKernel's PluginLoader uses object spread ({ ...plugin })
61- // which copies only own-enumerable properties, stripping prototype methods.
62- // This binds all prototype methods so they survive the spread.
63- // TODO: Remove once @objectstack /runtime fixes PluginLoader to preserve prototypes.
64- const fixedMswPlugin = { ...mswPlugin } as any ;
65- for ( const key of Object . getOwnPropertyNames ( Object . getPrototypeOf ( mswPlugin ) ) ) {
66- if ( typeof ( mswPlugin as any ) [ key ] === 'function' && key !== 'constructor' ) {
67- fixedMswPlugin [ key ] = ( mswPlugin as any ) [ key ] . bind ( mswPlugin ) ;
68- }
69- }
70-
71- await kernel . use ( fixedMswPlugin ) ;
60+ await kernel . use ( mswPlugin ) ;
7261
7362 await kernel . bootstrap ( ) ;
7463
You can’t perform that action at this time.
0 commit comments