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

Commit

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

//
Expand Down Expand Up @@ -47,6 +48,7 @@ describe('formlyMaterial - select type', () => {
$scope.$digest();
field = $scope.fields[0];
element = form.find('[ng-model]');
elementScope = element.scope();
}

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

it('should be able to be disabled', () => {
compile({
templateOptions: {
disabled: true
}
});

expect(element.attr('ng-disabled')).toBe(`options.templateOptions['disabled']`);
expect(elementScope.options.templateOptions.disabled).toBe(true);
});

describe('check options', () => {
afterEach(() => {
closeSelect();
Expand Down

0 comments on commit 9f76f0e

Please sign in to comment.