@@ -234,7 +234,19 @@ describe('Console Application Simulation', () => {
234234 expect ( screen . getByRole ( 'heading' , { name : / K i t c h e n S i n k / i } ) ) . toBeInTheDocument ( ) ;
235235 } ) ;
236236
237- expect ( document . body ) . toBeInTheDocument ( ) ;
237+ // Verify the form can be opened (showing metadata was loaded)
238+ const newButton = screen . getByRole ( 'button' , { name : / N e w K i t c h e n S i n k / i } ) ;
239+ fireEvent . click ( newButton ) ;
240+
241+ // Verify form loaded with schema-based fields
242+ await waitFor ( ( ) => {
243+ expect ( screen . getByRole ( 'dialog' ) ) . toBeInTheDocument ( ) ;
244+ } ) ;
245+
246+ // Form should render based on mocked schema
247+ // The actual field labels might differ based on implementation
248+ // but the form should render without errors
249+ expect ( screen . queryByText ( / e r r o r / i) ) . not . toBeInTheDocument ( ) ;
238250 } ) ;
239251
240252 // -----------------------------------------------------------------------------
@@ -257,14 +269,25 @@ describe('Console Application Simulation', () => {
257269 { id : '2' , name : 'Item 2' , amount : 200 }
258270 ] ;
259271
260- vi . spyOn ( mocks . MockDataSource . prototype , 'find' )
272+ const findSpy = vi . spyOn ( mocks . MockDataSource . prototype , 'find' )
261273 . mockResolvedValue ( { data : seedData } ) ;
262274
263275 renderApp ( '/kitchen_sink' ) ;
264276
265277 await waitFor ( ( ) => {
266278 expect ( screen . getByRole ( 'heading' , { name : / K i t c h e n S i n k / i } ) ) . toBeInTheDocument ( ) ;
267279 } ) ;
280+
281+ // Verify data source was called to load grid data
282+ await waitFor ( ( ) => {
283+ expect ( findSpy ) . toHaveBeenCalledWith ( 'kitchen_sink' , expect . any ( Object ) ) ;
284+ } ) ;
285+
286+ // Verify grid displays the loaded data
287+ await waitFor ( ( ) => {
288+ expect ( screen . getByText ( 'Item 1' ) ) . toBeInTheDocument ( ) ;
289+ } ) ;
290+ expect ( screen . getByText ( 'Item 2' ) ) . toBeInTheDocument ( ) ;
268291 } ) ;
269292
270293} ) ;
@@ -728,7 +751,17 @@ describe('Fields Integration', () => {
728751 expect ( mapFieldTypeToFormType ( 'number' ) ) . toBe ( 'field:number' ) ;
729752 expect ( mapFieldTypeToFormType ( 'boolean' ) ) . toBe ( 'field:boolean' ) ;
730753 expect ( mapFieldTypeToFormType ( 'select' ) ) . toBe ( 'field:select' ) ;
731- expect ( mapFieldTypeToFormType ( 'unknown_type' ) ) . toBe ( 'field:text' ) ; // default fallback
754+ } ) ;
755+
756+ it ( 'Scenario A.2: Unknown Field Type Fallback in Form' , async ( ) => {
757+ const { mapFieldTypeToFormType } = await import ( '@object-ui/fields' ) ;
758+
759+ // Verify unknown types fallback to text
760+ expect ( mapFieldTypeToFormType ( 'unknown_type' ) ) . toBe ( 'field:text' ) ;
761+ expect ( mapFieldTypeToFormType ( 'custom_widget' ) ) . toBe ( 'field:text' ) ;
762+
763+ // This ensures forms don't break when encountering unknown field types
764+ // The actual rendering is tested via the full form integration tests
732765 } ) ;
733766
734767 it ( 'Scenario B: Field Formatting Utilities' , async ( ) => {
0 commit comments