Open SDJCorp opened 3 years ago
When I merged in this change the test started failing. Restoring the value to 16 made the test pass again. So, I'm confused.
Reverting this for now.
Weird, maybe because of timezones or something? (the org I am using this on is based in Ireland)
That's a great hypothesis. Let's just comment out that assert for now until someone has time to dig into it.
Closing this out as we have moved fbc over to a managed package which will alleviate any install/test class coverage issues.
@adwhite75 Can we re-open this one? When we run "All tests", this fails on our orgs.
This is due to timezone differences, use a fixed user in 'America/Los_Angeles' and do a runAs() like:
@IsTest
static void parseFormulaTest() {
Profile pfile = [select id from profile where Name='System Administrator' limit 1];
User usr = new User( alias='utest', email='unitTester@UT.org', emailencodingkey='UTF-8',FirstName = 'beta',lastname='Tester',
languagelocalekey='en_US',localesidkey='en_US',profileid = pfile.Id,timezonesidkey='America/Los_Angeles',isActive = true,
username='unitTester@UT.org');
Test.startTest();
System.runAs(usr) {
**// add all test here...**
}
Test.stopTest();
}
anyone want to come up with a new pull request for this?
https://github.com/alexed1/LightningFlowComponents/blob/9fc80b515558596d49b8ac93041ef04a7fb710e4/flow_process_components/FlowBaseComponents/force-app/main/default/classes/fbc_FormulaEvaluatorTest.cls#L61
This fails:
System.assertEquals('16', fbc_FormulaEvaluator.parseFormula('HOURS(DATETIME(2019,12,26,0,0,0))', stringContext));
This Passes:
System.assertEquals('19', fbc_FormulaEvaluator.parseFormula('HOURS(DATETIME(2019,12,26,0,0,0))', stringContext));