From de32ea667af0cb4517101a9f82ac124771b11807 Mon Sep 17 00:00:00 2001 From: Mateusz7410 Date: Sat, 7 Nov 2026 15:36:29 +0000 Subject: [PATCH] fix: run the new chain count test as the operator user The package version build runs tests as its own user, and the WITH USER_MODE chain query threw 'Variable does not exist: tmpVar4' there. Running the snapshot as the operator, like the other timeline tests, fixes the build. --- .../classes/timeline/AsyncJobTimelineControllerTest.cls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/force-app/main/default/classes/timeline/AsyncJobTimelineControllerTest.cls b/force-app/main/default/classes/timeline/AsyncJobTimelineControllerTest.cls index cb2836c..246f7c1 100644 --- a/force-app/main/default/classes/timeline/AsyncJobTimelineControllerTest.cls +++ b/force-app/main/default/classes/timeline/AsyncJobTimelineControllerTest.cls @@ -219,7 +219,10 @@ private class AsyncJobTimelineControllerTest { Account otherOrder = new Account(Name = 'Other order'); insert otherOrder; seedChain(otherOrder, 'elsewhere', 'Elsewhere run', 1, System.now().addHours(-1)); - AsyncJobTimelineChains chains = new AsyncJobTimelineChains(order.Id, 7); + AsyncJobTimelineChains chains; + System.runAs(operator()) { + chains = new AsyncJobTimelineChains(order.Id, 7); + } live[1].Status__c = QueueableManager.STATUS_COMPLETED; update live[1];