Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 5bd535e

Browse files
author
Cody Mikol
committed
test (md-dialog)
Assert that md-dialog-container will not be given an md-theme attribute if the child it is propagated from does not contain a theme itself. Issue: #10276
1 parent cc73422 commit 5bd535e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/components/dialog/dialog.spec.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,31 @@ describe('$mdDialog', function() {
17741774
});
17751775

17761776
describe('theming', function () {
1777+
it('should not set md-theme if the child does not have md-theme to inherit', inject(function ($mdDialog, $mdTheming, $rootScope, $compile) {
1778+
1779+
var template = '<div id="rawContent">Hello</div>';
1780+
var parent = angular.element('<div>');
1781+
1782+
var button = $compile('<button ng-click="showDialog($event)">test</button>')($rootScope);
1783+
1784+
$mdTheming(button);
1785+
1786+
$rootScope.showDialog = function (ev) {
1787+
$mdDialog.show({
1788+
template: template,
1789+
parent: parent,
1790+
targetEvent: ev
1791+
});
1792+
};
1793+
1794+
button[0].click();
1795+
1796+
var container = angular.element(parent[0].querySelector('.md-dialog-container'));
1797+
1798+
expect(container.attr('md-theme')).toBeUndefined();
1799+
1800+
}));
1801+
17771802
it('should inherit targetElement theme', inject(function($mdDialog, $mdTheming, $rootScope, $compile) {
17781803
var template = '<div id="rawContent">Hello</div>';
17791804
var parent = angular.element('<div>');

0 commit comments

Comments
 (0)