Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 75b8e5a

Browse files
Foxandxsswesleycho
authored andcommitted
refactor(modal): mix both modal spec files
Closes #5011
1 parent 5e5c8b4 commit 75b8e5a

File tree

2 files changed

+38
-46
lines changed

2 files changed

+38
-46
lines changed

src/modal/test/modal.spec.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,44 @@ describe('$uibModal', function () {
10781078
});
10791079
});
10801080

1081+
describe('modal window', function() {
1082+
it('should not use transclusion scope for modals content - issue 2110', function() {
1083+
$rootScope.animate = false;
1084+
$compile('<div uib-modal-window animate="animate"><span ng-init="foo=true"></span></div>')($rootScope);
1085+
$rootScope.$digest();
1086+
1087+
expect($rootScope.foo).toBeTruthy();
1088+
});
1089+
1090+
it('should support custom CSS classes as string', function() {
1091+
$rootScope.animate = false;
1092+
var windowEl = $compile('<div uib-modal-window animate="animate" window-class="test foo">content</div>')($rootScope);
1093+
$rootScope.$digest();
1094+
1095+
expect(windowEl).toHaveClass('test');
1096+
expect(windowEl).toHaveClass('foo');
1097+
});
1098+
1099+
it('should support window top class', function () {
1100+
$rootScope.animate = false;
1101+
var windowEl = $compile('<div uib-modal-window animate="animate" window-top-class="test foo">content</div>')($rootScope);
1102+
$rootScope.$digest();
1103+
1104+
expect(windowEl).toHaveClass('test');
1105+
expect(windowEl).toHaveClass('foo');
1106+
});
1107+
1108+
it('should support custom template url', inject(function($templateCache) {
1109+
$templateCache.put('window.html', '<div class="mywindow" ng-transclude></div>');
1110+
1111+
var windowEl = $compile('<div uib-modal-window template-url="window.html" window-class="test">content</div>')($rootScope);
1112+
$rootScope.$digest();
1113+
1114+
expect(windowEl).toHaveClass('mywindow');
1115+
expect(windowEl).toHaveClass('test');
1116+
}));
1117+
});
1118+
10811119
describe('multiple modals', function() {
10821120
it('it should allow opening of multiple modals', function() {
10831121
var modal1 = open({template: '<div>Modal1</div>'});

src/modal/test/modalWindow.spec.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)