You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/25 00:58:37 UTC

svn commit: r1496268 - /incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetSelectCtrlTest.js

Author: joyce
Date: Mon Jun 24 22:58:37 2013
New Revision: 1496268

URL: http://svn.apache.org/r1496268
Log:
CLIMATE-152 progress - Add test for clearDatasets function

- Add test for clearDatasets function in DatasetSelectCtrlTest.

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetSelectCtrlTest.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetSelectCtrlTest.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetSelectCtrlTest.js?rev=1496268&r1=1496267&r2=1496268&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetSelectCtrlTest.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetSelectCtrlTest.js Mon Jun 24 22:58:37 2013
@@ -35,5 +35,17 @@ describe('OCW Controllers', function() {
 				expect(scope.shouldDisableClearButton()).toBe(false);
 			});
 		});
+
+		it('should initialize the clear datasets function', function() {
+			inject(function($rootScope, $controller, selectedDatasetInformation) {
+				var scope = $rootScope.$new();
+				var ctrl = $controller('DatasetSelectCtrl', {$rootScope: $rootScope, $scope: scope});
+
+				selectedDatasetInformation.addDataset({});
+				expect(selectedDatasetInformation.getDatasetCount()).toBe(1);
+				scope.clearDatasets();
+				expect(selectedDatasetInformation.getDatasetCount()).toBe(0);
+			});
+		});
 	});
 });