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