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

Commit 8a246f5

Browse files
author
Kamil Kisiela
committed
test(textarea): templateOptions.disabled
1 parent 178ac76 commit 8a246f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/types/textarea-spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ describe('formlyMaterial - textarea type', () => {
1111
let $scope;
1212
let form;
1313
let element;
14+
let elementScope;
1415
let field;
1516

1617
//
@@ -24,6 +25,7 @@ describe('formlyMaterial - textarea type', () => {
2425
type: 'textarea',
2526
templateOptions: {
2627
label: 'test field',
28+
disabled: true,
2729
rows: 5,
2830
cols: 6
2931
}
@@ -33,6 +35,7 @@ describe('formlyMaterial - textarea type', () => {
3335
$scope.$digest();
3436
field = $scope.fields[0];
3537
element = form.find('[ng-model]');
38+
elementScope = element.scope();
3639
}
3740

3841
//
@@ -89,4 +92,9 @@ describe('formlyMaterial - textarea type', () => {
8992
it('should be able to set cols', () => {
9093
expect(parseInt(element.attr('cols'), 10)).toEqual(field.templateOptions.cols);
9194
});
95+
96+
it('should be able to be disabled', () => {
97+
expect(element.attr('ng-disabled')).toBe(`options.templateOptions['disabled']`);
98+
expect(elementScope.options.templateOptions.disabled).toBe(true);
99+
});
92100
});

0 commit comments

Comments
 (0)