22import { describe , it , expect , vi } from 'vitest' ;
33import { render , screen , waitFor , fireEvent } from '@testing-library/react' ;
44import { MemoryRouter } from 'react-router-dom' ;
5- import React from 'react' ;
65
76// -----------------------------------------------------------------------------
87// SYSTEM INTEGRATION TEST: Console Application
@@ -225,9 +224,9 @@ describe('Console Application Simulation', () => {
225224 name : 'kitchen_sink' ,
226225 fields : {
227226 name : { type : 'text' , label : 'Name Field' } ,
228- amount : { type : 'number' , label : 'Amount Field' }
227+ amount : { type : 'number' , label : 'Amount Field' , scale : 0 }
229228 }
230- } ) ;
229+ } as any ) ;
231230
232231 renderApp ( '/kitchen_sink' ) ;
233232 await waitFor ( ( ) => {
@@ -424,7 +423,7 @@ describe('Kanban Integration', () => {
424423 }
425424 } ;
426425
427- vi . spyOn ( mocks . MockDataSource . prototype , 'getObjectSchema' ) . mockResolvedValue ( mockSchema ) ;
426+ vi . spyOn ( mocks . MockDataSource . prototype , 'getObjectSchema' ) . mockResolvedValue ( mockSchema as any ) ;
428427
429428 // Mock data for the kanban
430429 const mockTaskData = [
@@ -433,7 +432,7 @@ describe('Kanban Integration', () => {
433432 { id : '3' , title : 'Task 3' , description : 'Third task' , status : 'done' , priority : 'low' }
434433 ] ;
435434
436- vi . spyOn ( mocks . MockDataSource . prototype , 'find' ) . mockResolvedValue ( { data : mockTaskData } ) ;
435+ vi . spyOn ( mocks . MockDataSource . prototype , 'find' ) . mockResolvedValue ( { data : mockTaskData } as any ) ;
437436
438437 // Create a mock data source
439438 const dataSource = new mocks . MockDataSource ( ) ;
@@ -538,7 +537,7 @@ describe('Kanban Integration', () => {
538537 }
539538 ] ;
540539
541- vi . spyOn ( mocks . MockDataSource . prototype , 'find' ) . mockResolvedValue ( { data : seedData } ) ;
540+ vi . spyOn ( mocks . MockDataSource . prototype , 'find' ) . mockResolvedValue ( { data : seedData } as any ) ;
542541 vi . spyOn ( mocks . MockDataSource . prototype , 'getObjectSchema' ) . mockResolvedValue ( {
543542 name : 'project_task' ,
544543 fields : {
@@ -547,7 +546,7 @@ describe('Kanban Integration', () => {
547546 status : { type : 'picklist' , label : 'Status' } ,
548547 priority : { type : 'picklist' , label : 'Priority' }
549548 }
550- } ) ;
549+ } as any ) ;
551550
552551 // Create a mock data source
553552 const dataSource = new mocks . MockDataSource ( ) ;
@@ -588,7 +587,6 @@ describe('Kanban Integration', () => {
588587 const { KanbanRenderer } = await import ( '@object-ui/plugin-kanban' ) ;
589588
590589 // Setup: Spy on update method (though drag-drop in JSDOM is complex)
591- const updateSpy = vi . fn ( ) . mockResolvedValue ( { id : 'task-1' , status : 'done' } ) ;
592590 const onCardMoveSpy = vi . fn ( ) ;
593591
594592 // Simple static data test with event binding
@@ -689,7 +687,7 @@ describe('Kanban Integration', () => {
689687
690688 const findSpy = vi . spyOn ( mocks . MockDataSource . prototype , 'find' ) . mockResolvedValue ( {
691689 data : initialData
692- } ) ;
690+ } as any ) ;
693691
694692 vi . spyOn ( mocks . MockDataSource . prototype , 'getObjectSchema' ) . mockResolvedValue ( {
695693 name : 'project_task' ,
@@ -698,11 +696,11 @@ describe('Kanban Integration', () => {
698696 status : { type : 'picklist' , label : 'Status' } ,
699697 priority : { type : 'picklist' , label : 'Priority' }
700698 }
701- } ) ;
699+ } as any ) ;
702700
703701 const dataSource = new mocks . MockDataSource ( ) ;
704702
705- const { rerender } = render (
703+ render (
706704 < ObjectKanban
707705 schema = { {
708706 type : 'kanban' ,
@@ -812,6 +810,7 @@ describe('Dashboard Integration', () => {
812810 } ) ;
813811
814812 it ( 'Scenario C: Component Registry Check' , async ( ) => {
813+ // @ts -expect-error - Importing from transitive dependency for testing
815814 const { ComponentRegistry } = await import ( '@object-ui/core' ) ;
816815
817816 const dashboardRenderer = ComponentRegistry . get ( 'dashboard' ) ;
0 commit comments