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

Commit

Permalink
test(radio): disabled options
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela committed Jan 12, 2016
1 parent f2d2e40 commit c04f63d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/types/radio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe('formlyMaterial - radio type', () => {

field.templateOptions.options.forEach((option, key) => {
const el = angular.element(optionsElements[key]);

expect(el.attr('value')).toBe(option.value);
expect(el.find('.md-label > span').html()).toContain(option.name);
});
Expand Down Expand Up @@ -106,4 +107,21 @@ describe('formlyMaterial - radio type', () => {
expect(el.find('.md-label > span').html()).toContain(option.nameUp);
});
});

it('should has disabled options', () => {
compile({
templateOptions: {
disabled: true
}
});

expect(optionsElements.length).toBe(field.templateOptions.options.length);

field.templateOptions.options.forEach((option, key) => {
const el = angular.element(optionsElements[key]);

expect(el.attr('ng-disabled')).toBe('to.disabled');
expect(el.scope().to.disabled).toBe(true);
});
});
});

0 comments on commit c04f63d

Please sign in to comment.