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

Commit f6b5890

Browse files
author
Kamil Kisiela
committed
test(slider): templateOptions.disabled
1 parent 9f76f0e commit f6b5890

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/types/slider-spec.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ describe('formlyMaterial - slider type', () => {
1010
let $scope;
1111
let form;
1212
let element;
13+
let elementScope;
1314
const fieldConfig = {
1415
key: 'testField',
1516
type: 'slider',
1617
templateOptions: {
1718
label: 'test field',
19+
disabled: true,
1820
min: 1,
1921
max: 5,
2022
step: 0.5,
@@ -32,6 +34,7 @@ describe('formlyMaterial - slider type', () => {
3234
form = $compile(testUtils.getFormTemplate())($scope);
3335
$scope.$digest();
3436
element = form.find('[ng-model]');
37+
elementScope = element.scope();
3538
}
3639

3740
//
@@ -66,9 +69,12 @@ describe('formlyMaterial - slider type', () => {
6669
});
6770

6871
it('should support discrete option', () => {
69-
const scope = angular.element(element).scope();
70-
7172
expect(element.attr('md-discrete')).toEqual(`options.templateOptions['discrete']`);
72-
expect(scope.options.templateOptions.discrete).toBe(fieldConfig.templateOptions.discrete);
73+
expect(elementScope.options.templateOptions.discrete).toBe(fieldConfig.templateOptions.discrete);
74+
});
75+
76+
it('should be able to be disabled', () => {
77+
expect(element.attr('ng-disabled')).toBe(`options.templateOptions['disabled']`);
78+
expect(elementScope.options.templateOptions.disabled).toBe(true);
7379
});
7480
});

0 commit comments

Comments
 (0)