Skip to content

Commit c129028

Browse files
fix: bump agents lib W-22776265 (#434)
* chore: bump agents lib * fix: use dynamic dates in tests
1 parent 33ddd42 commit c129028

3 files changed

Lines changed: 503 additions & 533 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"@inquirer/prompts": "^7.10.1",
1313
"@oclif/core": "^4",
1414
"@oclif/multi-stage-output": "^0.8.36",
15-
"@salesforce/agents": "^1.6.6",
15+
"@salesforce/agents": "^1.7.1",
1616
"@salesforce/core": "^8.28.3",
1717
"@salesforce/kit": "^3.2.6",
1818
"@salesforce/sf-plugins-core": "^12.2.6",
1919
"@salesforce/source-deploy-retrieve": "^12.35.3",
20-
"@salesforce/types": "^1.7.1",
20+
"@salesforce/types": "1.7.1",
2121
"ansis": "^3.3.2",
2222
"fast-xml-parser": "^5.7.1",
2323
"glob": "^11.0.3",

test/commands/agent/trace/list.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { SfProject } from '@salesforce/core';
2626
const MOCK_PROJECT_DIR = join(process.cwd(), 'test', 'mock-projects', 'agent-generate-template');
2727

2828
const RECENT_MTIME = new Date(Date.now() - 7 * 86_400_000);
29+
const MIDDLE_MTIME = new Date(Date.now() - 30 * 86_400_000);
2930
const OLD_MTIME = new Date(Date.now() - 60 * 86_400_000);
3031

3132
const 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

Comments
 (0)