Skip to content

Commit

Permalink
Adding Chart services Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhuka committed Jun 24, 2015
1 parent 79cdaa4 commit 59cdd46
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/spec/chart-factory/nvd3-chart-factory.js
Original file line number Diff line number Diff line change
@@ -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();
});*/
});
});
28 changes: 28 additions & 0 deletions test/spec/chart-factory/services.js
Original file line number Diff line number Diff line change
@@ -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');
});
});
});
28 changes: 28 additions & 0 deletions test/spec/services/services.js
Original file line number Diff line number Diff line change
@@ -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');
});
});
});

0 comments on commit 59cdd46

Please sign in to comment.