File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
public/app/plugins/datasource/graphite/specs Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -160,4 +160,27 @@ describe('GraphiteQueryCtrl', function() {
160
160
expect ( ctx . panelCtrl . refresh . called ) . to . be ( true ) ;
161
161
} ) ;
162
162
} ) ;
163
+
164
+ describe ( 'when updating targets with nested query' , function ( ) {
165
+ beforeEach ( function ( ) {
166
+ ctx . ctrl . target . target = 'scaleToSeconds(#A)' ;
167
+ ctx . ctrl . datasource . metricFindQuery = sinon . stub ( ) . returns ( ctx . $q . when ( [ { expandable : false } ] ) ) ;
168
+ ctx . ctrl . parseTarget ( ) ;
169
+
170
+ ctx . ctrl . panelCtrl . panel . targets = [ {
171
+ target : 'nested.query.count' ,
172
+ refId : 'A'
173
+ } ] ;
174
+
175
+ ctx . ctrl . updateModelTarget ( ) ;
176
+ } ) ;
177
+
178
+ it ( 'target should remain the same' , function ( ) {
179
+ expect ( ctx . ctrl . target . target ) . to . be ( 'scaleToSeconds(#A)' ) ;
180
+ } ) ;
181
+
182
+ it ( 'targetFull should include nexted queries' , function ( ) {
183
+ expect ( ctx . ctrl . target . targetFull ) . to . be ( 'scaleToSeconds(nested.query.count)' ) ;
184
+ } ) ;
185
+ } ) ;
163
186
} ) ;
You can’t perform that action at this time.
0 commit comments