1- import  {  render ,  screen ,  fireEvent ,  waitFor  }  from  '@testing-library/react' ; 
1+ import  {  render ,  screen ,  waitFor ,  fireEvent  }  from  '@testing-library/react' ; 
2+ import  {  CLEAR_HISTORY_REMINDER_TIME  }  from  '../../constants' ; 
23import  {  getIpcApi  }  from  '../../lib/get-ipc-api' ; 
34import  AIClearHistoryReminder  from  '../ai-clear-history-reminder' ; 
45import  type  {  Message  }  from  '../../hooks/use-assistant' ; 
@@ -7,15 +8,15 @@ jest.mock( '../../lib/get-ipc-api' );
78
89describe (  'AIClearHistoryReminder' ,  ( )  =>  { 
910	let  clearConversation : jest . Mock ; 
10- 	const  MOCKED_TIME  =  1718882159928 ; 
11- 	const  TWO_HOURS_DIFF  =  2   *   60   *   60   *   1000 ; 
11+ 	const  MOCKED_CURRENT_TIME  =  1718882159928 ; 
12+ 	const  OLD_MESSAGE_TIME  =  MOCKED_CURRENT_TIME   -   CLEAR_HISTORY_REMINDER_TIME   -   1 ; 
1213
1314	beforeEach (  ( )  =>  { 
1415		window . HTMLElement . prototype . scrollIntoView  =  jest . fn ( ) ; 
1516		clearConversation  =  jest . fn ( ) ; 
1617		jest . clearAllMocks ( ) ; 
1718		jest . useFakeTimers ( ) ; 
18- 		jest . setSystemTime (  MOCKED_TIME  ) ; 
19+ 		jest . setSystemTime (  MOCKED_CURRENT_TIME  ) ; 
1920	}  ) ; 
2021
2122	afterEach (  ( )  =>  { 
@@ -25,7 +26,7 @@ describe( 'AIClearHistoryReminder', () => {
2526	it (  'should display a reminder when the conversation is stale' ,  ( )  =>  { 
2627		const  message : Message  =  { 
2728			id : 0 , 
28- 			createdAt : MOCKED_TIME   -   TWO_HOURS_DIFF , 
29+ 			createdAt : OLD_MESSAGE_TIME , 
2930			content : '' , 
3031			role : 'assistant' , 
3132		} ; 
@@ -42,7 +43,7 @@ describe( 'AIClearHistoryReminder', () => {
4243		}  ) ; 
4344		const  message : Message  =  { 
4445			id : 0 , 
45- 			createdAt : MOCKED_TIME   -   TWO_HOURS_DIFF , 
46+ 			createdAt : OLD_MESSAGE_TIME , 
4647			content : '' , 
4748			role : 'assistant' , 
4849		} ; 
@@ -65,7 +66,7 @@ describe( 'AIClearHistoryReminder', () => {
6566		}  ) ; 
6667		const  message : Message  =  { 
6768			id : 0 , 
68- 			createdAt : MOCKED_TIME   -   TWO_HOURS_DIFF , 
69+ 			createdAt : OLD_MESSAGE_TIME , 
6970			content : '' , 
7071			role : 'assistant' , 
7172		} ; 
0 commit comments