From 6ed36e01ac7fe5700de9f76ad392db378a91196a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 15 Dec 2015 13:52:14 +0100 Subject: [PATCH] fix(unit tests): moved kairosdb spec to it's plugin repo --- .../test/specs/kairosdb-datasource-specs.js | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 public/test/specs/kairosdb-datasource-specs.js diff --git a/public/test/specs/kairosdb-datasource-specs.js b/public/test/specs/kairosdb-datasource-specs.js deleted file mode 100644 index 47cb2d7bc46..00000000000 --- a/public/test/specs/kairosdb-datasource-specs.js +++ /dev/null @@ -1,66 +0,0 @@ -define([ - './helpers', - 'app/plugins/datasource/kairosdb/datasource' -], function(helpers) { - 'use strict'; - - describe('KairosDBDatasource', function() { - var ctx = new helpers.ServiceTestContext(); - - beforeEach(module('grafana.core')); - beforeEach(module('grafana.services')); - - beforeEach(ctx.providePhase(['templateSrv'])); - beforeEach(ctx.createService('KairosDBDatasource')); - - beforeEach(function() { - ctx.ds = new ctx.service({ url: ''}); - }); - - describe('When querying kairosdb with one target using query editor target spec', function() { - var results; - var urlExpected = "/api/v1/datapoints/query"; - var bodyExpected = { - metrics: [{ name: "test" }], - cache_time: 0, - start_relative: { - value: "1", - unit: "hours" - } - }; - - var query = { - rangeRaw: { from: 'now-1h', to: 'now' }, - targets: [{ metric: 'test', downsampling: '(NONE)'}] - }; - - var response = { - queries: [{ - sample_size: 60, - results: [{ - name: "test", - values: [[1420070400000, 1]] - }] - }] - }; - - beforeEach(function() { - ctx.$httpBackend.expect('POST', urlExpected, bodyExpected).respond(response); - ctx.ds.query(query).then(function(data) { results = data; }); - ctx.$httpBackend.flush(); - }); - - it('should generate the correct query', function() { - ctx.$httpBackend.verifyNoOutstandingExpectation(); - }); - - it('should return series list', function() { - expect(results.data.length).to.be(1); - expect(results.data[0].target).to.be('test'); - }); - - }); - - }); - -});