@@ -23,6 +23,7 @@ import {
2323import { FormBuilderService } from '../form-builder.service' ;
2424import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model' ;
2525import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service' ;
26+ import { getTypeBindRelations } from './type-bind.utils' ;
2627
2728describe ( 'DSDynamicTypeBindRelationService test suite' , ( ) => {
2829 let service : DsDynamicTypeBindRelationService ;
@@ -82,7 +83,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
8283 } ) ;
8384 it ( 'Should get 1 related form models for mock relation model data' , ( ) => {
8485 const testModel = mockInputWithTypeBindModel ;
85- testModel . typeBindRelations = DsDynamicTypeBindRelationService . getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
86+ testModel . typeBindRelations = getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
8687 const relatedModels = service . getRelatedFormModel ( testModel ) ;
8788 expect ( relatedModels ) . toHaveSize ( 1 ) ;
8889 } ) ;
@@ -91,7 +92,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
9192 describe ( 'Test matchesCondition method' , ( ) => {
9293 it ( 'Should receive one subscription to dc.type type binding"' , ( ) => {
9394 const testModel = mockInputWithTypeBindModel ;
94- testModel . typeBindRelations = DsDynamicTypeBindRelationService . getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
95+ testModel . typeBindRelations = getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
9596 const dcTypeControl = new UntypedFormControl ( ) ;
9697 dcTypeControl . setValue ( 'boundType' ) ;
9798 let subscriptions = service . subscribeRelations ( testModel , dcTypeControl ) ;
@@ -100,7 +101,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
100101
101102 it ( 'Expect hasMatch to be true (ie. this should be hidden)' , ( ) => {
102103 const testModel = mockInputWithTypeBindModel ;
103- testModel . typeBindRelations = DsDynamicTypeBindRelationService . getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
104+ testModel . typeBindRelations = getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
104105 const dcTypeControl = new UntypedFormControl ( ) ;
105106 dcTypeControl . setValue ( 'boundType' ) ;
106107 testModel . typeBindRelations [ 0 ] . when [ 0 ] . value = 'anotherType' ;
@@ -115,7 +116,7 @@ describe('DSDynamicTypeBindRelationService test suite', () => {
115116
116117 it ( 'Expect hasMatch to be false (ie. this should NOT be hidden)' , ( ) => {
117118 const testModel = mockInputWithTypeBindModel ;
118- testModel . typeBindRelations = DsDynamicTypeBindRelationService . getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
119+ testModel . typeBindRelations = getTypeBindRelations ( [ 'boundType' ] , 'dc.type' ) ;
119120 const dcTypeControl = new UntypedFormControl ( ) ;
120121 dcTypeControl . setValue ( 'boundType' ) ;
121122 testModel . typeBindRelations [ 0 ] . when [ 0 ] . value = 'boundType' ;
0 commit comments