Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit 9f76f0e

Browse files
author
Kamil Kisiela
committed
test(select): templateOptions.disabled
1 parent 18c819f commit 9f76f0e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/types/select-spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('formlyMaterial - select type', () => {
1313
let $material;
1414
let form;
1515
let element;
16+
let elementScope;
1617
let field;
1718

1819
//
@@ -47,6 +48,7 @@ describe('formlyMaterial - select type', () => {
4748
$scope.$digest();
4849
field = $scope.fields[0];
4950
element = form.find('[ng-model]');
51+
elementScope = element.scope();
5052
}
5153

5254
function waitForSelectOpen() {
@@ -109,6 +111,17 @@ describe('formlyMaterial - select type', () => {
109111
expect(element.attr('md-on-open')).toBe(`options.templateOptions['onOpen']`);
110112
});
111113

114+
it('should be able to be disabled', () => {
115+
compile({
116+
templateOptions: {
117+
disabled: true
118+
}
119+
});
120+
121+
expect(element.attr('ng-disabled')).toBe(`options.templateOptions['disabled']`);
122+
expect(elementScope.options.templateOptions.disabled).toBe(true);
123+
});
124+
112125
describe('check options', () => {
113126
afterEach(() => {
114127
closeSelect();

0 commit comments

Comments
 (0)