@@ -68,6 +68,27 @@ describe('Script object multiselect', () => {
6868 assert . ok ( ! object . excludedFromUpdateFields . includes ( 'Custom__c' ) ) ;
6969 } ) ;
7070
71+ it ( 'excludes multiselect fields from expanded original query fields' , ( ) => {
72+ const script = new Script ( ) ;
73+ const object = new ScriptObject ( 'Account' ) ;
74+ object . query = 'SELECT all FROM Account' ;
75+ object . excludedFields = [ 'Type' ] ;
76+ object . setup ( script ) ;
77+
78+ const describe = createDescribe ( 'Account' , [
79+ { name : 'Id' , type : 'id' , updateable : false , creatable : false } ,
80+ { name : 'Name' , type : 'string' , updateable : true , creatable : true , nameField : true } ,
81+ { name : 'Type' , type : 'string' , updateable : true , creatable : true } ,
82+ ] ) ;
83+
84+ object . applyDescribe ( describe ) ;
85+
86+ assert . ok ( object . fieldsInQuery . includes ( 'Name' ) ) ;
87+ assert . ok ( ! object . fieldsInQuery . includes ( 'Type' ) ) ;
88+ assert . ok ( object . expandedOriginalQueryFields . includes ( 'Name' ) ) ;
89+ assert . ok ( ! object . expandedOriginalQueryFields . includes ( 'Type' ) ) ;
90+ } ) ;
91+
7192 it ( 'applies keyword AND logic' , ( ) => {
7293 const script = new Script ( ) ;
7394 const object = new ScriptObject ( 'Contact' ) ;
0 commit comments