From 8fd51bebad6b993ccd81df2f9ab945466752f93e Mon Sep 17 00:00:00 2001 From: madhuka Date: Sat, 4 Jul 2015 23:46:48 +0530 Subject: [PATCH] adding few usecase test for chart type switch with chart library --- test/spec/controllers/use-case-test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/spec/controllers/use-case-test.js b/test/spec/controllers/use-case-test.js index 4870494..af8d632 100644 --- a/test/spec/controllers/use-case-test.js +++ b/test/spec/controllers/use-case-test.js @@ -27,5 +27,27 @@ describe("apacheZeppelinGsocApp UseCase Testing", function() { newchart = nvd3chart; expect(newchart.libname).toBe('NVD3Chart'); }); + it("HighChart Bar to Google Line chart", function() { + var newchart = highChart; + expect(newchart.viewModel.options.chart.type).toBe('bar'); + newchart = myChart; + newchart.setChartType('Line'); + expect(newchart.viewModel.type).toBe('LineChart'); + }); + it("HighChart Line to Google Bar chart", function() { + var newchart = highChart; + newchart.setChartType('Line'); + expect(newchart.viewModel.options.chart.type).toBe('line'); + newchart = myChart; + newchart.setChartType('Bar'); + expect(newchart.viewModel.type).toBe('BarChart'); + }); + it("NVD3 Bar to Google Line chart", function() { + var newchart = nvd3chart; + expect(newchart.viewModel.options.chart.type).toBe('multiBarHorizontalChart'); + newchart = myChart; + newchart.setChartType('Line'); + expect(newchart.viewModel.type).toBe('LineChart'); + }); }); }); \ No newline at end of file