From 59cdd46369138b95b34eb0966c3e2093388d798d Mon Sep 17 00:00:00 2001 From: madhuka Date: Wed, 24 Jun 2015 19:19:13 +0530 Subject: [PATCH] Adding Chart services Test --- test/spec/chart-factory/nvd3-chart-factory.js | 16 +++++++++++ test/spec/chart-factory/services.js | 28 +++++++++++++++++++ test/spec/services/services.js | 28 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 test/spec/chart-factory/nvd3-chart-factory.js create mode 100644 test/spec/chart-factory/services.js create mode 100644 test/spec/services/services.js diff --git a/test/spec/chart-factory/nvd3-chart-factory.js b/test/spec/chart-factory/nvd3-chart-factory.js new file mode 100644 index 0000000..1d77223 --- /dev/null +++ b/test/spec/chart-factory/nvd3-chart-factory.js @@ -0,0 +1,16 @@ +'use strict'; + +describe("apacheZeppelinGsocApp NVD3ChartFactory", function() { + beforeEach(module("apacheZeppelinGsocApp")); + var NVD3ChartFactory; + beforeEach(inject(function(NVD3ChartFactory) { + NVD3ChartFactory = NVD3ChartFactory; + })); + describe("Testing Function APIs", function() { + /* it("NVD3ChartFactory to be define", function() { + expect(NVD3ChartFactory).toBeDefined(); + expect(NVD3ChartFactory.ChartList).toBeDefined(); + expect(NVD3ChartFactory.viewModel()).toBeDefined(); + });*/ + }); +}); \ No newline at end of file diff --git a/test/spec/chart-factory/services.js b/test/spec/chart-factory/services.js new file mode 100644 index 0000000..f5cdcde --- /dev/null +++ b/test/spec/chart-factory/services.js @@ -0,0 +1,28 @@ +'use strict'; + +describe("apacheZeppelinGsocApp chartService", function() { + beforeEach(module("apacheZeppelinGsocApp")); + var chartService; + beforeEach(inject(function(ChartService) { + chartService = ChartService; + })); + describe("Testing Function APIs", function() { + it("chartService to be define", function() { + expect(chartService).toBeDefined(); + expect(chartService.getHighChart()).toBeDefined(); + expect(chartService.getGoogleChart()).toBeDefined(); + expect(chartService.getNVD3Chart()).toBeDefined(); + }); + }); + describe("Testing Function Operations", function() { + it("chartService on getGoogleChart", function() { + expect(chartService).toBeDefined(); + expect(chartService.getGoogleChart('Bar')).toBeDefined(); + expect(chartService.getGoogleChart('Line').libname).toBe( + 'googleChart'); + expect(chartService.getGoogleChart('Line').type).toBe('Line'); + expect(chartService.getGoogleChart('Line').viewModel.type).toBe( + 'LineChart'); + }); + }); +}); \ No newline at end of file diff --git a/test/spec/services/services.js b/test/spec/services/services.js new file mode 100644 index 0000000..f5cdcde --- /dev/null +++ b/test/spec/services/services.js @@ -0,0 +1,28 @@ +'use strict'; + +describe("apacheZeppelinGsocApp chartService", function() { + beforeEach(module("apacheZeppelinGsocApp")); + var chartService; + beforeEach(inject(function(ChartService) { + chartService = ChartService; + })); + describe("Testing Function APIs", function() { + it("chartService to be define", function() { + expect(chartService).toBeDefined(); + expect(chartService.getHighChart()).toBeDefined(); + expect(chartService.getGoogleChart()).toBeDefined(); + expect(chartService.getNVD3Chart()).toBeDefined(); + }); + }); + describe("Testing Function Operations", function() { + it("chartService on getGoogleChart", function() { + expect(chartService).toBeDefined(); + expect(chartService.getGoogleChart('Bar')).toBeDefined(); + expect(chartService.getGoogleChart('Line').libname).toBe( + 'googleChart'); + expect(chartService.getGoogleChart('Line').type).toBe('Line'); + expect(chartService.getGoogleChart('Line').viewModel.type).toBe( + 'LineChart'); + }); + }); +}); \ No newline at end of file