• Deniz Ataş
  • NEWBIE
  • 5 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 2
    Replies
@isTest
private class TestCtrTurnoverEntryCmp {
    
    @isTest
    static void testTurnoverEntry(){
        
        UserRole portalRole = [Select Id From UserRole Where PortalType = 'None' Limit 1];
        Profile profile1 = [Select Id from Profile where name = 'System Administrator'];
        User newUser = new User(
            UserRoleId = portalRole.Id,
            ProfileId = profile1.id,
            Username = 'test@managemall.com',
            email = 'test@managemall.com',
            emailencodingkey = 'UTF-8',
            localesidkey = 'en_US',
            languagelocalekey = 'en_US',
            timezonesidkey = 'America/Los_Angeles',
            alias ='nuser',
            lastname ='sahin'
        );
        insert newUser;
        
        system.runAs(newUser) 
        {
            System.debug('Current User: ' + UserInfo.getUserName());
            
            Account acc = new Account(Name = 'portalAccount', OwnerId = newUser.Id);
            insert acc;
            
            Contact con = new Contact (
                AccountId = acc.id,
                LastName = 'portalContact'
            );
            insert con;
            
            User user2 = [SELECT AccountId FROM User WHERE Username =: 
            UserInfo.getUserName()];
            System.debug('user1: ' + user1.AccountId); // this return null

            Test.startTest();
           ......
            Test.stopTest();
        }

    }
}

 
@isTest
private class TestCtrTurnoverEntryCmp {
    
    @isTest
    static void testTurnoverEntry(){
        
        UserRole portalRole = [Select Id From UserRole Where PortalType = 'None' Limit 1];
        Profile profile1 = [Select Id from Profile where name = 'System Administrator'];
        User newUser = new User(
            UserRoleId = portalRole.Id,
            ProfileId = profile1.id,
            Username = 'test@managemall.com',
            email = 'test@managemall.com',
            emailencodingkey = 'UTF-8',
            localesidkey = 'en_US',
            languagelocalekey = 'en_US',
            timezonesidkey = 'America/Los_Angeles',
            alias ='nuser',
            lastname ='sahin'
        );
        insert newUser;
        
        system.runAs(newUser) 
        {
            System.debug('Current User: ' + UserInfo.getUserName());
            
            Account acc = new Account(Name = 'portalAccount', OwnerId = newUser.Id);
            insert acc;
            
            Contact con = new Contact (
                AccountId = acc.id,
                LastName = 'portalContact'
            );
            insert con;
            
            User user2 = [SELECT AccountId FROM User WHERE Username =: 
            UserInfo.getUserName()];
            System.debug('user1: ' + user1.AccountId); // this return null

            Test.startTest();
           ......
            Test.stopTest();
        }

    }
}

 

I'm following the documtation found at https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_add_cmp_salesforce1.htm , but even with the 'implements="force:appHostable"' set in my aura:component, the Lightning Component isn't available when I try to add a new Lightning Tab.

Any insight?

I'm following the documtation found at https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_add_cmp_salesforce1.htm , but even with the 'implements="force:appHostable"' set in my aura:component, the Lightning Component isn't available when I try to add a new Lightning Tab.

Any insight?