@@ -115,7 +115,29 @@ describe('gridClassFactory', function() {
115
115
expect ( testSetup . col . cellTemplate ) . toEqual ( '<div>a sample cell template with custom_filters</div>' ) ;
116
116
expect ( testSetup . col . footerCellTemplate ) . toEqual ( '<div>a sample footer template with custom_filters</div>' ) ;
117
117
} ) ;
118
-
118
+
119
+ it ( 'column builder passes double dollars as parameters to the filters correctly' , function ( ) {
120
+ testSetup . $templateCache . put ( 'ui-grid/uiGridHeaderCell' , '<div>a sample header template with CUSTOM_FILTERS</div>' ) ;
121
+ testSetup . $templateCache . put ( 'ui-grid/uiGridCell' , '<div>a sample cell template with CUSTOM_FILTERS</div>' ) ;
122
+ testSetup . $templateCache . put ( 'ui-grid/uiGridFooterCell' , '<div>a sample footer template with CUSTOM_FILTERS</div>' ) ;
123
+
124
+ testSetup . col . cellFilter = 'customCellFilter:row.entity.$$internalValue' ;
125
+ testSetup . col . headerCellFilter = 'customHeaderCellFilter:row.entity.$$internalValue' ;
126
+ testSetup . col . footerCellFilter = 'customFooterCellFilter:row.entity.$$internalValue' ;
127
+
128
+ gridClassFactory . defaultColumnBuilder ( testSetup . colDef , testSetup . col , testSetup . gridOptions ) ;
129
+
130
+ expect ( testSetup . col . providedHeaderCellTemplate ) . toEqual ( 'ui-grid/uiGridHeaderCell' ) ;
131
+ expect ( testSetup . col . providedCellTemplate ) . toEqual ( 'ui-grid/uiGridCell' ) ;
132
+ expect ( testSetup . col . providedFooterCellTemplate ) . toEqual ( 'ui-grid/uiGridFooterCell' ) ;
133
+
134
+ testSetup . $rootScope . $digest ( ) ;
135
+
136
+ expect ( testSetup . col . headerCellTemplate ) . toEqual ( '<div>a sample header template with |customHeaderCellFilter:row.entity.$$internalValue</div>' ) ;
137
+ expect ( testSetup . col . cellTemplate ) . toEqual ( '<div>a sample cell template with |customCellFilter:row.entity.$$internalValue</div>' ) ;
138
+ expect ( testSetup . col . footerCellTemplate ) . toEqual ( '<div>a sample footer template with |customFooterCellFilter:row.entity.$$internalValue</div>' ) ;
139
+ } ) ;
140
+
119
141
} ) ;
120
142
121
143
} ) ;
0 commit comments