@@ -650,18 +650,39 @@ describe('mdCheckbox', function() {
650650 it ( 'should change from the indeterminate to checked state correctly' , function ( ) {
651651 var checked = false ;
652652 pageScope . isChecked = function ( ) { return checked ; } ;
653- pageScope . isIndet = function ( ) { return ! checked ; } ;
653+ pageScope . isIndeterminate = function ( ) { return ! checked ; } ;
654654
655- var checkbox = compileAndLink ( '<md-checkbox md-indeterminate="isIndet ()" ng-checked="isChecked()"></md-checkbox>' ) ;
655+ var checkbox = compileAndLink ( '<md-checkbox md-indeterminate="isIndeterminate ()" ng-checked="isChecked()"></md-checkbox>' ) ;
656656
657657 expect ( checkbox ) . toHaveClass ( INDETERMINATE_CSS ) ;
658658 expect ( checkbox ) . not . toHaveClass ( CHECKED_CSS ) ;
659+ expect ( checkbox . attr ( 'aria-checked' ) ) . toEqual ( 'mixed' ) ;
659660
660661 checked = true ;
661662 pageScope . $apply ( ) ;
662663
663664 expect ( checkbox ) . not . toHaveClass ( INDETERMINATE_CSS ) ;
664665 expect ( checkbox ) . toHaveClass ( CHECKED_CSS ) ;
666+ expect ( checkbox . attr ( 'aria-checked' ) ) . toEqual ( 'true' ) ;
667+ } ) ;
668+
669+ it ( 'should change from the indeterminate to unchecked state correctly' , function ( ) {
670+ var checked = true ;
671+ pageScope . isChecked = function ( ) { return checked ; } ;
672+ pageScope . isIndeterminate = function ( ) { return checked ; } ;
673+
674+ var checkbox = compileAndLink ( '<md-checkbox md-indeterminate="isIndeterminate()" ng-checked="isChecked()"></md-checkbox>' ) ;
675+
676+ expect ( checkbox ) . toHaveClass ( INDETERMINATE_CSS ) ;
677+ expect ( checkbox ) . not . toHaveClass ( CHECKED_CSS ) ;
678+ expect ( checkbox . attr ( 'aria-checked' ) ) . toEqual ( 'mixed' ) ;
679+
680+ checked = false ;
681+ pageScope . $apply ( ) ;
682+
683+ expect ( checkbox ) . not . toHaveClass ( INDETERMINATE_CSS ) ;
684+ expect ( checkbox ) . not . toHaveClass ( CHECKED_CSS ) ;
685+ expect ( checkbox . attr ( 'aria-checked' ) ) . toEqual ( 'false' ) ;
665686 } ) ;
666687
667688 it ( 'should mark the checkbox as selected, if the model is true and "md-indeterminate" is false' , function ( ) {
@@ -670,6 +691,7 @@ describe('mdCheckbox', function() {
670691
671692 expect ( checkbox ) . toHaveClass ( CHECKED_CSS ) ;
672693 expect ( checkbox ) . not . toHaveClass ( INDETERMINATE_CSS ) ;
694+ expect ( checkbox . attr ( 'aria-checked' ) ) . toEqual ( 'true' ) ;
673695 } ) ;
674696
675697 } ) ;
0 commit comments