@@ -4,7 +4,7 @@ import ConditionsTable from '../ConditionsTable';
44import { usePatientUUID } from '@hooks/usePatientUUID' ;
55import { useConditions } from '@hooks/useConditions' ;
66import { formatConditions } from '@services/conditionService' ;
7- import { formatDateTime } from '@utils/date' ;
7+ import { formatDate , formatDateTime } from '@utils/date' ;
88import { generateId } from '@utils/common' ;
99import {
1010 mockPatientUUID ,
@@ -105,13 +105,17 @@ const mockedFormatConditions = formatConditions as jest.MockedFunction<
105105const mockedFormatDateTime = formatDateTime as jest . MockedFunction <
106106 typeof formatDateTime
107107> ;
108+ const mockedFormatDate = formatDate as jest . MockedFunction <
109+ typeof formatDateTime
110+ > ;
108111const mockedGenerateId = generateId as jest . MockedFunction < typeof generateId > ;
109112
110113describe ( 'ConditionsTable Unit Tests' , ( ) => {
111114 beforeEach ( ( ) => {
112115 jest . clearAllMocks ( ) ;
113116 mockedGenerateId . mockReturnValue ( 'mock-id' ) ;
114117 mockedFormatDateTime . mockImplementation ( ( date ) => `Formatted: ${ date } ` ) ;
118+ mockedFormatDate . mockImplementation ( ( date ) => `Formatted: ${ date } ` ) ;
115119 } ) ;
116120
117121 // 1. Component Initialization and Hook Interactions
@@ -396,7 +400,7 @@ describe('ConditionsTable Unit Tests', () => {
396400 expect ( screen . getByTestId ( 'cell-onsetDate-0' ) ) . toHaveTextContent (
397401 'Formatted: 2025-03-24T18:30:00+00:00' ,
398402 ) ;
399- expect ( formatDateTime ) . toHaveBeenCalledWith ( '2025-03-24T18:30:00+00:00' ) ;
403+ expect ( formatDate ) . toHaveBeenCalledWith ( '2025-03-24T18:30:00+00:00' ) ;
400404 } ) ;
401405
402406 it ( 'should render recorder cell correctly' , ( ) => {
@@ -494,7 +498,7 @@ describe('ConditionsTable Unit Tests', () => {
494498 expect ( screen . getByTestId ( 'cell-onsetDate-0' ) ) . toHaveTextContent (
495499 'Formatted:' ,
496500 ) ;
497- expect ( formatDateTime ) . toHaveBeenCalledWith ( '' ) ;
501+ expect ( formatDate ) . toHaveBeenCalledWith ( '' ) ;
498502 } ) ;
499503
500504 it ( 'should handle empty recordedDate' , ( ) => {
0 commit comments