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

Commit aec4e60

Browse files
author
Kamil Kisiela
committed
test(checkbox): templateOptions.disabled
1 parent 858f9fa commit aec4e60

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/types/checkbox-spec.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('formlyMaterial - checkbox type', () => {
99
let $rootScope;
1010
let $scope;
1111
let element;
12+
let elementScope;
1213

1314
//
1415
// helpers
@@ -20,14 +21,16 @@ describe('formlyMaterial - checkbox type', () => {
2021
key: 'testField',
2122
type: 'checkbox',
2223
templateOptions: {
23-
label: 'test field'
24+
label: 'test field',
25+
disabled: true
2426
}
2527
}, options)];
2628

2729
const form = $compile(testUtils.getFormTemplate())($scope);
2830

2931
$scope.$digest();
3032
element = form.find('[ng-model]');
33+
elementScope = angular.element(element).scope();
3134
}
3235

3336
//
@@ -52,4 +55,9 @@ describe('formlyMaterial - checkbox type', () => {
5255
it('should have label', () => {
5356
expect(element.html()).toContain('test field');
5457
});
58+
59+
it('should be disabled', () => {
60+
expect(element.attr('ng-disabled')).toBe(`options.templateOptions['disabled']`);
61+
expect(elementScope.options.templateOptions.disabled).toBe(true);
62+
});
5563
});

0 commit comments

Comments
 (0)