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/24 15:31:14 UTC
svn commit: r1496049 - in
/incubator/climate/trunk/rcmet/src/main/ui/test/unit/directives: ./
BootstrapModalTest.js
Author: joyce
Date: Mon Jun 24 13:31:13 2013
New Revision: 1496049
URL: http://svn.apache.org/r1496049
Log:
Resolve CLIMATE-151 - Update BootstrapModal directive tests
- Move tests to BootstrapModalTest.js.
Added:
incubator/climate/trunk/rcmet/src/main/ui/test/unit/directives/
incubator/climate/trunk/rcmet/src/main/ui/test/unit/directives/BootstrapModalTest.js
Added: incubator/climate/trunk/rcmet/src/main/ui/test/unit/directives/BootstrapModalTest.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/test/unit/directives/BootstrapModalTest.js?rev=1496049&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/test/unit/directives/BootstrapModalTest.js (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/test/unit/directives/BootstrapModalTest.js Mon Jun 24 13:31:13 2013
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+**/
+'use strict';
+
+describe('directives', function() {
+ beforeEach(module('ocw'));
+
+ describe('bootstrap-modal directive', function() {
+ it('should create a div element of the correct form', function() {
+ inject(function($compile, $rootScope) {
+ var element = $compile('<bootstrap-modal modal-id="testmodal"></bootstrap-modal>')($rootScope);
+ expect(element.hasClass("modal")).toBeTruthy();
+ expect(element.hasClass("hide")).toBeTruthy();
+ expect(element.attr("id")).toEqual('{{modalId}}');
+ });
+ });
+
+ it('should properly wrap the interior html content' , function() {
+ inject(function($compile, $rootScope) {
+ var element = $compile('<bootstrap-modal modal-id="testmodal"><h3>Hello</h3></bootstrap-modal>')($rootScope);
+ expect(element.html()).toEqual("<div ng-transclude=\"\"><h3 class=\"ng-scope\">Hello</h3></div>");
+ });
+ });
+ });
+});