@@ -307,8 +307,12 @@ describe('Console Application Simulation', () => {
307307 { id : '2' , name : 'Item 2' , amount : 200 }
308308 ] ;
309309
310+ const originalFind = mocks . MockDataSource . prototype . find ;
310311 const findSpy = vi . spyOn ( mocks . MockDataSource . prototype , 'find' )
311- . mockResolvedValue ( { data : seedData } ) ;
312+ . mockImplementation ( async function ( this : any , objectName : string ) {
313+ if ( objectName === 'kitchen_sink' ) return { data : seedData } ;
314+ return originalFind . call ( this , objectName ) ;
315+ } ) ;
312316
313317 renderApp ( '/kitchen_sink' ) ;
314318
@@ -326,6 +330,8 @@ describe('Console Application Simulation', () => {
326330 expect ( screen . getByText ( 'Item 1' ) ) . toBeInTheDocument ( ) ;
327331 } , { timeout : 5000 } ) ;
328332 expect ( screen . getByText ( 'Item 2' ) ) . toBeInTheDocument ( ) ;
333+
334+ findSpy . mockRestore ( ) ;
329335 } ) ;
330336
331337} ) ;
@@ -728,7 +734,7 @@ describe('Kanban Integration', () => {
728734 data : initialData
729735 } as any ) ;
730736
731- vi . spyOn ( mocks . MockDataSource . prototype , 'getObjectSchema' ) . mockResolvedValue ( {
737+ const schemaSpy = vi . spyOn ( mocks . MockDataSource . prototype , 'getObjectSchema' ) . mockResolvedValue ( {
732738 name : 'project_task' ,
733739 fields : {
734740 title : { type : 'text' , label : 'Title' } ,
@@ -772,6 +778,10 @@ describe('Kanban Integration', () => {
772778 // For now, we verify the component can handle the initial load
773779 // and that data source was called correctly
774780 expect ( findSpy ) . toHaveBeenCalledWith ( 'project_task' , expect . any ( Object ) ) ;
781+
782+ // Restore spies to avoid affecting subsequent tests
783+ findSpy . mockRestore ( ) ;
784+ schemaSpy . mockRestore ( ) ;
775785 } ) ;
776786} ) ;
777787
@@ -828,23 +838,23 @@ describe('Dashboard Integration', () => {
828838 } ;
829839
830840 it ( 'Scenario A: Dashboard Page Rendering' , async ( ) => {
831- renderApp ( '/dashboard/showcase_dashboard ' ) ;
841+ renderApp ( '/dashboard/crm_dashboard ' ) ;
832842
833843 await waitFor ( ( ) => {
834- expect ( screen . getByText ( / P l a t f o r m S h o w c a s e / i) ) . toBeInTheDocument ( ) ;
835- } ) ;
844+ expect ( screen . getByText ( / C R M O v e r v i e w / i) ) . toBeInTheDocument ( ) ;
845+ } , { timeout : 10000 } ) ;
836846
837- expect ( screen . getByText ( / R e c o r d s b y C a t e g o r y / i) ) . toBeInTheDocument ( ) ;
847+ expect ( screen . getByText ( / R e v e n u e T r e n d s / i) ) . toBeInTheDocument ( ) ;
838848 } ) ;
839849
840850 it ( 'Scenario B: Help Page Rendering' , async ( ) => {
841- renderApp ( '/page/showcase_help ' ) ;
851+ renderApp ( '/page/crm_help ' ) ;
842852
843853 await waitFor ( ( ) => {
844- expect ( screen . getByText ( / P l a t f o r m S h o w c a s e / i) ) . toBeInTheDocument ( ) ;
845- } ) ;
854+ expect ( screen . getByText ( / C R M H e l p G u i d e / i) ) . toBeInTheDocument ( ) ;
855+ } , { timeout : 10000 } ) ;
846856
847- expect ( screen . getByText ( / S u p p o r t e d F i e l d T y p e s / i) ) . toBeInTheDocument ( ) ;
857+ expect ( screen . getByText ( / K e y b o a r d S h o r t c u t s / i) ) . toBeInTheDocument ( ) ;
848858 } ) ;
849859
850860 it ( 'Scenario C: Component Registry Check' , async ( ) => {
0 commit comments