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

Commit da3c20e

Browse files
author
Cody Mikol
committed
test (md-dialog)
Assert that md-dialog-container will be given the md-theme attribute of the child it is propogated from given that it has an md-theme. Issue: #10276
1 parent 5bd535e commit da3c20e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/components/dialog/dialog.spec.js

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

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

17791805
var template = '<div id="rawContent">Hello</div>';

0 commit comments

Comments
 (0)