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

Commit c04f63d

Browse files
author
Kamil Kisiela
committed
test(radio): disabled options
1 parent f2d2e40 commit c04f63d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/types/radio-spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ describe('formlyMaterial - radio type', () => {
7070

7171
field.templateOptions.options.forEach((option, key) => {
7272
const el = angular.element(optionsElements[key]);
73+
7374
expect(el.attr('value')).toBe(option.value);
7475
expect(el.find('.md-label > span').html()).toContain(option.name);
7576
});
@@ -106,4 +107,21 @@ describe('formlyMaterial - radio type', () => {
106107
expect(el.find('.md-label > span').html()).toContain(option.nameUp);
107108
});
108109
});
110+
111+
it('should has disabled options', () => {
112+
compile({
113+
templateOptions: {
114+
disabled: true
115+
}
116+
});
117+
118+
expect(optionsElements.length).toBe(field.templateOptions.options.length);
119+
120+
field.templateOptions.options.forEach((option, key) => {
121+
const el = angular.element(optionsElements[key]);
122+
123+
expect(el.attr('ng-disabled')).toBe('to.disabled');
124+
expect(el.scope().to.disabled).toBe(true);
125+
});
126+
});
109127
});

0 commit comments

Comments
 (0)