@@ -26,6 +26,7 @@ import { SfProject } from '@salesforce/core';
2626const MOCK_PROJECT_DIR = join ( process . cwd ( ) , 'test' , 'mock-projects' , 'agent-generate-template' ) ;
2727
2828const RECENT_MTIME = new Date ( Date . now ( ) - 7 * 86_400_000 ) ;
29+ const MIDDLE_MTIME = new Date ( Date . now ( ) - 30 * 86_400_000 ) ;
2930const OLD_MTIME = new Date ( Date . now ( ) - 60 * 86_400_000 ) ;
3031
3132const MOCK_TRACES_AGENT_A = [
@@ -153,7 +154,8 @@ describe('agent trace list', () => {
153154 describe ( '--since filter' , ( ) => {
154155 it ( 'returns only traces at or after the given date (date-only)' , async ( ) => {
155156 // RECENT_MTIME is 2026-04-07, OLD_MTIME is 2026-03-01
156- const result = await AgentTraceList . run ( [ '--since' , '2026-04-01' ] ) ;
157+ const dateString = MIDDLE_MTIME . toISOString ( ) . slice ( 0 , 10 ) . toString ( ) ;
158+ const result = await AgentTraceList . run ( [ '--since' , dateString ] ) ;
157159 const planIds = result . map ( ( r : any ) => r . planId ) ;
158160 expect ( planIds ) . to . include ( 'plan-1' ) ;
159161 expect ( planIds ) . to . not . include ( 'plan-2' ) ;
@@ -205,7 +207,8 @@ describe('agent trace list', () => {
205207
206208 describe ( 'combined filters' , ( ) => {
207209 it ( 'applies --agent and --since together' , async ( ) => {
208- const result = await AgentTraceList . run ( [ '--agent' , 'My_Agent_A' , '--since' , '2026-04-01' ] ) ;
210+ const dateString = MIDDLE_MTIME . toISOString ( ) . slice ( 0 , 10 ) . toString ( ) ;
211+ const result = await AgentTraceList . run ( [ '--agent' , 'My_Agent_A' , '--since' , dateString ] ) ;
209212 expect ( result ) . to . have . length ( 1 ) ;
210213 expect ( result [ 0 ] . planId ) . to . equal ( 'plan-1' ) ;
211214 } ) ;
0 commit comments