From 4e44571819b90d39d363181184a57286f6ba2d8e Mon Sep 17 00:00:00 2001 From: Shivam Dave Date: Fri, 4 Sep 2015 12:54:35 -0700 Subject: [PATCH] [Gestures] Tests Created initialization of variables and components to MCTChart additions. --- .../test/directives/MCTChartSpec.js | 27 +++++++++++++++++-- platform/features/plot-reborn/test/suite.json | 3 ++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/platform/features/plot-reborn/test/directives/MCTChartSpec.js b/platform/features/plot-reborn/test/directives/MCTChartSpec.js index 9b9873b27d..085544e0eb 100644 --- a/platform/features/plot-reborn/test/directives/MCTChartSpec.js +++ b/platform/features/plot-reborn/test/directives/MCTChartSpec.js @@ -22,15 +22,38 @@ /*global define,Promise,describe,it,expect,xit,beforeEach,waitsFor,jasmine*/ define( - ["../src/directives/MCTChart"], + ["../../src/directives/MCTChart"], function (MCTChart) { "use strict"; describe("The MCT Chart directive", function () { - var mockScope; + var mockInterval, + mockLog, + mockAgentService, + mockScope, + mockElement, + mockCanvas, + mctChart; beforeEach(function () { + mockInterval = + jasmine.createSpyObj("$interval", [ "cancel" ]); + mockLog = jasmine.createSpyObj("$log", [ "warn" ]); + mockAgentService = jasmine.createSpyObj("agentService", ["isMobile"]); + mockCanvas = jasmine.createSpyObj("canvas", [ "getContext", "addEventListener" ]); + mockScope = + jasmine.createSpyObj("$scope", [ "$on", "$watch", "series", "viewport", "rectangles" ]); + mockElement = + jasmine.createSpyObj("$element", [ "find" ]); + + mctChart = new MCTChart(mockInterval, mockAgentService); + }); + + it("Calls", function() { + mockElement.find.andReturn([mockCanvas]); + + //mctChart.link(mockScope, mockElement); }); }); } diff --git a/platform/features/plot-reborn/test/suite.json b/platform/features/plot-reborn/test/suite.json index c0385d351a..0ebc279fc3 100644 --- a/platform/features/plot-reborn/test/suite.json +++ b/platform/features/plot-reborn/test/suite.json @@ -1,4 +1,5 @@ [ - "controllers/PlotController" + "controllers/PlotController", + "directives/MCTChart" ]