• Alex Yorio
  • NEWBIE
  • 20 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
I have inherited a Test Class that covers two triggers in my org.

When I run the Test Class is the Sandbox Developer Console, I have 77% and 76% code coverage for the triggers.

When I try to deploy the triggers to production, they fail with code coverage of 10% and 7&.

The Test Class uses seealldata=true, and I believe this is why the code coverage fails in production, but I do not know how to update this test to get the necessary coverage.

Here is the Test Class:

@isTest(SeeAllData=true)
private class PulseTriggerTests {
 
    static testMethod void doTests() {
       
        WebServiceCallout.isApexTest = true;
       
        //Insert placement
        Unicore_Placement__c placement = new Unicore_Placement__c();
        placement.Name = 'TestPlacement';
        placement.Pulse_ID__c = '1';
       
        insert placement;
       
        //Insert Account
        Account a = new Account();
        a.Name = 'TestAccount';
        a.Type__c = 'Customer';
        a.UNGST_Prop_Code__c = 'TestAccount';
        a.Name_on_Sign__c = 'TestAccount';
        a.Flag_Prop_Code__c = '1';
        a.Brand_Name__c = 'Hilton';
        //a.Pulse_Environments_To_Sync__c = 'Staging;Demonstration;Development';
       
        insert a;
       
        //Insert Asset
        Asset s = new Asset();
        s.Name = 'TestAsset';
        s.AccountId = a.Id;
        s.Status = 'Installed';
        s.Asset_Type__c = 'Business Center';
        s.Active__c = true;
        //s.Pulse_Environments_To_Sync__c = 'Staging;Demonstration;Development';
       
        insert s;
       
        s.Asset_Type__c = 'Tradeshow Screensaver';
        update s;
       
        s.Asset_Type__c = 'CP Business Center';
        update s;
       
        s.Asset_Type__c = 'Boarding Pass';
        update s;
       
        s.Placement__c = placement.Id;
        s.Asset_Type__c = 'Concierge Station';
        update s;
       
        s.Asset_Type__c = 'Chalkboard';
        update s;
       
        s.Asset_Type__c = 'Information Board';
        update s;
       
        s.Active__c = false;
        update s;
    }
   
    public static testMethod void test_sendPulseNotification()
    {
        WebServiceCallout.isApexTest = true;
       
        Pulse_Sync_Status__c status = new Pulse_Sync_Status__c();
       
        status.Item_ID__c = '1';
        status.Object_Type__c = 'Account';
       
        insert status;
       
        Map<String,String> headers;
        WebServiceCallout.sendPulseNotification('', '400-code', 'POST', headers, status.Id, 'Production');
    }
   
    // run WebServiceCallout.testMe(); from Execute Anonymous to test
    public static testMethod void test_logError()
    {      
        //No existing error
        WebServiceCallout.logError('1', 'Error', 'Production');
       
        //Make a status
        Pulse_Sync_Status__c status = new Pulse_Sync_Status__c();
       
        status.Item_ID__c = '1';
        status.Object_Type__c = 'Account';
       
        insert status;
       
        //Error already exists
        WebServiceCallout.logError(status.Id, 'Error 2', 'Production');
    }
   
    public static testMethod void test_logSuccess()
    {      
        Pulse_Sync_Status__c status = new Pulse_Sync_Status__c();
       
        status.Item_ID__c = '1';
        status.Object_Type__c = 'Account';
        status.Last_Message__c = 'Error';
       
        insert status;
       
        WebServiceCallout.logSuccess(status.Id, 'Success', 'Production');
    }
   
    public static testMethod void test_logUnregistered()
    {      
        Pulse_Sync_Status__c status = new Pulse_Sync_Status__c();
       
        status.Item_ID__c = '1';
        status.Object_Type__c = 'Account';
        status.Last_Message__c = 'Error';
       
        insert status;
       
        WebServiceCallout.logUnregistered(status.Id, 'Success', 'Production');
    }
}
 

I am having issues with displaying a variable on the Display Text screen of my flow.

Normally, I use a Get Records to get and save the value.

Then on a screen, I add a Display Text screen component and insert my saved variable as a resource. This has worked for me in the past; however, when I debug the flow, it does not show the variable and is blank.

Has anyone encountered a workaround for this?

Hi,

I have a flow with several elements that use the Display Text screen component to pair text with an image that I have inserted.

When I look at these Flows in my org, I see the images properly displayed. When I log in to my Salesforce community, I see them as well; however, when a user with our community profile logs in, they do not see the images.

Is there a permission required for these images to display to a community user?

Here is an example of what I see:
User-added image
Here is what someone with the community profile sees:

User-added image
Hi,

I have a flow with several elements that use the Display Text screen component to pair text with an image that I have inserted.

When I look at these Flows in my org, I see the images properly displayed. When I log in to my Salesforce community, I see them as well; however, when a user with our community profile logs in, they do not see the images.

Is there a permission required for these images to display to a community user?

Here is an example of what I see:
User-added image
Here is what someone with the community profile sees:

User-added image