@@ -2,7 +2,6 @@ import {describe, beforeEach, it, sinon, expect} from 'test/lib/common';
2
2
import InfluxSeries from '../influx_series' ;
3
3
4
4
describe ( 'when generating timeseries from influxdb response' , function ( ) {
5
-
6
5
describe ( 'given multiple fields for series' , function ( ) {
7
6
var options = {
8
7
alias : '' ,
@@ -68,6 +67,7 @@ describe('when generating timeseries from influxdb response', function() {
68
67
69
68
} ) ;
70
69
} ) ;
70
+
71
71
describe ( 'given measurement with default fieldname' , function ( ) {
72
72
var options = { series : [
73
73
{
@@ -96,6 +96,7 @@ describe('when generating timeseries from influxdb response', function() {
96
96
} ) ;
97
97
98
98
} ) ;
99
+
99
100
describe ( 'given two series' , function ( ) {
100
101
var options = {
101
102
alias : '' ,
@@ -206,5 +207,32 @@ describe('when generating timeseries from influxdb response', function() {
206
207
} ) ;
207
208
} ) ;
208
209
210
+ describe ( 'given annotation response' , function ( ) {
211
+ var options = {
212
+ alias : '' ,
213
+ annotation : {
214
+ tagsColumn : 'datacenter, source'
215
+ } ,
216
+ series : [
217
+ {
218
+ name : "logins.count" ,
219
+ tags : { datacenter : 'Africa' , server : 'server2' } ,
220
+ columns : [ "time" , "datacenter" , "hostname" , "source" , "value" ] ,
221
+ values : [
222
+ [ 1481549440372 , "America" , "10.1.100.10" , "backend" , 215.7432653659507 ] ,
223
+ ]
224
+ }
225
+ ]
226
+ } ;
227
+
228
+ it ( 'should multiple tags' , function ( ) {
229
+ var series = new InfluxSeries ( options ) ;
230
+ var annotations = series . getAnnotations ( ) ;
231
+
232
+ expect ( annotations [ 0 ] . tags . length ) . to . be ( 2 ) ;
233
+ expect ( annotations [ 0 ] . tags [ 0 ] ) . to . be ( 'America' ) ;
234
+ expect ( annotations [ 0 ] . tags [ 1 ] ) . to . be ( 'backend' ) ;
235
+ } ) ;
236
+ } ) ;
209
237
} ) ;
210
238
0 commit comments