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

Commit

Permalink
test(textarea): templateOptions.disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela committed Jan 12, 2016
1 parent 178ac76 commit 8a246f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/types/textarea-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('formlyMaterial - textarea type', () => {
let $scope;
let form;
let element;
let elementScope;
let field;

//
Expand All @@ -24,6 +25,7 @@ describe('formlyMaterial - textarea type', () => {
type: 'textarea',
templateOptions: {
label: 'test field',
disabled: true,
rows: 5,
cols: 6
}
Expand All @@ -33,6 +35,7 @@ describe('formlyMaterial - textarea type', () => {
$scope.$digest();
field = $scope.fields[0];
element = form.find('[ng-model]');
elementScope = element.scope();
}

//
Expand Down Expand Up @@ -89,4 +92,9 @@ describe('formlyMaterial - textarea type', () => {
it('should be able to set cols', () => {
expect(parseInt(element.attr('cols'), 10)).toEqual(field.templateOptions.cols);
});

it('should be able to be disabled', () => {
expect(element.attr('ng-disabled')).toBe(`options.templateOptions['disabled']`);
expect(elementScope.options.templateOptions.disabled).toBe(true);
});
});

0 comments on commit 8a246f5

Please sign in to comment.