File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 66 [id] ="inputId "
77 [required] ="required "
88 [checked] ="checked "
9- [value] ="value "
9+ [attr. value] ="value "
1010 [disabled] ="disabled "
11- [name] ="name "
11+ [attr. name] ="name "
1212 [tabIndex] ="tabIndex "
1313 [indeterminate] ="indeterminate "
1414 [attr.aria-label] ="ariaLabel "
Original file line number Diff line number Diff line change @@ -873,6 +873,17 @@ describe('MatCheckbox', () => {
873873 . not . toContain ( 'mat-checkbox-inner-container-no-side-margin' ) ;
874874 } , 1 ) ;
875875 } ) ) ;
876+
877+ it ( 'should not add the "name" attribute if it is not passed in' , ( ) => {
878+ fixture . detectChanges ( ) ;
879+ expect ( checkboxInnerContainer . querySelector ( 'input' ) ! . hasAttribute ( 'name' ) ) . toBe ( false ) ;
880+ } ) ;
881+
882+ it ( 'should not add the "value" attribute if it is not passed in' , ( ) => {
883+ fixture . detectChanges ( ) ;
884+ expect ( checkboxInnerContainer . querySelector ( 'input' ) ! . hasAttribute ( 'value' ) ) . toBe ( false ) ;
885+ } ) ;
886+
876887 } ) ;
877888} ) ;
878889
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc
169169 @Output ( ) indeterminateChange : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
170170
171171 /** The value attribute of the native input element */
172- @Input ( ) value : string ;
172+ @Input ( ) value : string ;
173173
174174 /** The native `<input type="checkbox"> element */
175175 @ViewChild ( 'input' ) _inputElement : ElementRef ;
You can’t perform that action at this time.
0 commit comments