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 2014/08/05 19:32:07 UTC

[09/19] git commit: Transition previewmap tests

Transition previewmap tests


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/0f824302
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/0f824302
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/0f824302

Branch: refs/heads/master
Commit: 0f824302e7c31ce7a5db195109149db4c36fcaec
Parents: ce9715b
Author: Michael Joyce <jo...@apache.org>
Authored: Fri Aug 1 13:41:26 2014 -0700
Committer: Michael Joyce <jo...@apache.org>
Committed: Mon Aug 4 15:01:02 2014 -0700

----------------------------------------------------------------------
 .../test/spec/directives/previewmap.js          | 24 ++++++++++++++++----
 1 file changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/0f824302/ocw-ui/frontend-new/test/spec/directives/previewmap.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend-new/test/spec/directives/previewmap.js b/ocw-ui/frontend-new/test/spec/directives/previewmap.js
index c99f063..2a831c6 100644
--- a/ocw-ui/frontend-new/test/spec/directives/previewmap.js
+++ b/ocw-ui/frontend-new/test/spec/directives/previewmap.js
@@ -31,9 +31,23 @@ describe('Directive: previewMap', function () {
     scope = $rootScope.$new();
   }));
 
-  it('should make hidden element visible', inject(function ($compile) {
-    element = angular.element('<preview-map></preview-map>');
-    element = $compile(element)(scope);
-    expect(element.text()).toBe('this is the previewMap directive');
-  }));
+  it('should set the proper class', function() {
+    inject(function($compile, $rootScope) {
+      $rootScope.dataset = {latlonVals: {latMax: 90, lonMax: 90, latMin: -90, lonMin: -90}, name: "TRMM"};
+
+      var element = $compile('<div preview-map="dataset"></div>')($rootScope);
+
+      expect(element.hasClass("preview-map")).toBeTruthy();
+    });
+  });
+  
+  it('should set the id of the template to the name of the dataset', function() {
+    inject(function($compile, $rootScope) {
+      $rootScope.dataset = {latlonVals: {latMax: 90, lonMax: 90, latMin: -90, lonMin: -90}, name: "TRMM"};
+
+      var element = $compile('<div preview-map="dataset"></div>')($rootScope);
+
+      expect(element.attr('id')).toEqual("{{dataset.name}}");
+    });
+  });
 });