Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.6.33 - THIS_MONTH date literal bugfix #617

Merged
merged 6 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ As well, don't miss [the Wiki](../../wiki), which includes even more info for co

## Deployment & Setup

<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObbvAAC">
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObeQAAS">
<img alt="Deploy to Salesforce"
src="./media/deploy-package-to-prod.png">
</a>

<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObbvAAC">
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObeQAAS">
<img alt="Deploy to Salesforce Sandbox"
src="./media/deploy-package-to-sandbox.png">
</a>
Expand Down
19 changes: 18 additions & 1 deletion extra-tests/classes/RollupDateLiteralTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ private class RollupDateLiteralTests {
)
);
insert cpcs;

insert new User(
LastName = 'Australia User',
Username = '' + System.now().getTime() + '@RollupDateLiteralTests.org',
Email = '[email protected]',
EmailEncodingKey = 'ISO-8859-1',
Alias = 'aususer',
TimeZoneSidKey = 'Australia/Sydney',
LocaleSidKey = 'en_US',
LanguageLocaleKey = 'en_US',
ProfileId = UserInfo.getProfileId()
);
}

@IsTest
Expand Down Expand Up @@ -175,7 +187,7 @@ private class RollupDateLiteralTests {
System.assertEquals(
true,
literal.matches(possibleDate, equality),
'Literal defined as ' + literal + ' should have matched ' + possibleDate + ' for ' + equality + '\n'
'Literal defined as ' + literal + ' should have matched ' + possibleDate + ' for ' + equality + ' for timezone ' + UserInfo.getTimeZone() + '\n'
);
}

Expand Down Expand Up @@ -217,6 +229,11 @@ private class RollupDateLiteralTests {
@IsTest
static void shouldWorkForThisMonth() {
runTestForLiteral('THIS_MONTH');
// TODO extend this more generally throughout this test class
User australiaUser = [SELECT Id FROM User WHERE LastName = 'Australia User'];
System.runAs(australiaUser) {
runTestForLiteral('THIS_MONTH');
}
}

@IsTest
Expand Down
23 changes: 20 additions & 3 deletions extra-tests/classes/RollupFullRecalcTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1738,8 +1738,8 @@ private class RollupFullRecalcTests {

@IsTest
static void limitsFullBatchRecalcCachedItemsProperly() {
Rollup.defaultControl = new RollupControl__mdt(ShouldRunAs__c = RollupMetaPicklists.ShouldRunAs.Synchronous);
Account parentA = [SELECT Id FROM Account];
Rollup.defaultControl = new RollupControl__mdt(ShouldRunAs__c = RollupMetaPicklists.ShouldRunAs.Synchronous, IsRollupLoggingEnabled__c = true);
Account parentA = [SELECT Id, OwnerId FROM Account];
Account parentB = new Account(Name = 'Parent B');
Account parentC = new Account(Name = 'Parent C');
insert new List<SObject>{ parentB, parentC };
Expand Down Expand Up @@ -1768,7 +1768,22 @@ private class RollupFullRecalcTests {
LookupObject__c = 'Account',
LookupFieldOnLookupObject__c = 'Id',
RollupFieldOnLookupObject__c = 'AnnualRevenue',
RollupOperation__c = 'SUM'
RollupOperation__c = 'SUM',
FullRecalculationDefaultNumberValue__c = 0,
IsFullRecordSet__c = true
),
new Rollup__mdt(
CalcItem__c = 'ContactPointAddress',
RollupFieldOnCalcItem__c = 'PreferenceRank',
LookupFieldOnCalcItem__c = 'ParentId',
LookupObject__c = 'User',
LookupFieldOnLookupObject__c = 'Id',
RollupFieldOnLookupObject__c = 'JigsawImportLimitOverride',
GrandparentRelationshipFieldPath__c = 'Parent.Owner.JigsawImportLimitOverride',
RollupOperation__c = 'SUM',
CalcItemWhereClause__c = 'ParentId = \'' + parentA.Id + '\'',
FullRecalculationDefaultNumberValue__c = 0,
IsFullRecordSet__c = true
),
new Rollup__mdt(
CalcItem__c = 'ContactPointAddress',
Expand Down Expand Up @@ -1817,6 +1832,8 @@ private class RollupFullRecalcTests {
System.assertEquals(String.valueOf(true), parent.Sic, parent);
}
System.assertEquals(true, Rollup.CACHED_ROLLUPS.isEmpty(), 'all deferrals should have been run');
User parentAOwner = [SELECT Id, JigsawImportLimitOverride FROM User WHERE Id = :parentA.OwnerId];
System.assertEquals(6, parentAOwner.JigsawImportLimitOverride);
}

@IsTest
Expand Down
Loading