Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BF7B10EA6 for ; Tue, 18 Jun 2013 18:50:27 +0000 (UTC) Received: (qmail 73531 invoked by uid 500); 18 Jun 2013 18:50:27 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 73502 invoked by uid 500); 18 Jun 2013 18:50:27 -0000 Mailing-List: contact commits-help@climate.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.incubator.apache.org Delivered-To: mailing list commits@climate.incubator.apache.org Received: (qmail 73494 invoked by uid 99); 18 Jun 2013 18:50:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jun 2013 18:50:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jun 2013 18:50:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4BB192388B56; Tue, 18 Jun 2013 18:50:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1494247 - /incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js Date: Tue, 18 Jun 2013 18:50:07 -0000 To: commits@climate.incubator.apache.org From: joyce@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130618185007.4BB192388B56@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: joyce Date: Tue Jun 18 18:50:06 2013 New Revision: 1494247 URL: http://svn.apache.org/r1494247 Log: Resolved CLIMATE-122 - Add tests for DatasetDisplayCtrl - Add setRegridBase test. Modified: incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js Modified: incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js?rev=1494247&r1=1494246&r2=1494247&view=diff ============================================================================== --- incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js (original) +++ incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js Tue Jun 18 18:50:06 2013 @@ -40,5 +40,26 @@ describe('OCW Controllers', function() { expect(scope.datasets[0]).toBe(2); }); }); + + it('should initialize the setRegridBase function', function() { + inject(function($rootScope, $controller) { + var scope = $rootScope.$new(); + var ctrl = $controller("DatasetDisplayCtrl", {$scope: scope}); + + scope.datasets.push({regrid: false}); + scope.datasets.push({regrid: true}); + scope.datasets.push({regrid: true}); + scope.datasets.push({regrid: false}); + + expect(scope.datasets[1].regrid).toBe(true); + expect(scope.datasets[2].regrid).toBe(true); + + // setRegridBase should set all indices to 'false' if if it's not the passed index + scope.setRegridBase(2); + + expect(scope.datasets[1].regrid).toBe(false); + expect(scope.datasets[2].regrid).toBe(true); + }); + }); }); });