@@ -108,7 +108,7 @@ describe('datepicker directive', function () {
108108
109109 describe ( '' , function ( ) {
110110 beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
111- element = $compile ( '<datepicker ng-model="$parent. date"></datepicker>' ) ( $rootScope ) ;
111+ element = $compile ( '<datepicker ng-model="date"></datepicker>' ) ( $rootScope ) ;
112112 $rootScope . $digest ( ) ;
113113 } ) ) ;
114114
@@ -445,7 +445,7 @@ describe('datepicker directive', function () {
445445 describe ( 'attribute `starting-day`' , function ( ) {
446446 beforeEach ( function ( ) {
447447 $rootScope . startingDay = 1 ;
448- element = $compile ( '<datepicker ng-model="$parent. date" starting-day="startingDay"></datepicker>' ) ( $rootScope ) ;
448+ element = $compile ( '<datepicker ng-model="date" starting-day="startingDay"></datepicker>' ) ( $rootScope ) ;
449449 $rootScope . $digest ( ) ;
450450 } ) ;
451451
@@ -472,7 +472,7 @@ describe('datepicker directive', function () {
472472 var weekHeader , weekElement ;
473473 beforeEach ( function ( ) {
474474 $rootScope . showWeeks = false ;
475- element = $compile ( '<datepicker ng-model="$parent. date" show-weeks="showWeeks"></datepicker>' ) ( $rootScope ) ;
475+ element = $compile ( '<datepicker ng-model="date" show-weeks="showWeeks"></datepicker>' ) ( $rootScope ) ;
476476 $rootScope . $digest ( ) ;
477477
478478 weekHeader = getLabelsRow ( ) . find ( 'th' ) . eq ( 0 ) ;
@@ -481,29 +481,29 @@ describe('datepicker directive', function () {
481481
482482 it ( 'hides week numbers based on variable' , function ( ) {
483483 expect ( weekHeader . text ( ) ) . toEqual ( '#' ) ;
484- expect ( weekHeader . css ( 'display' ) ) . toBe ( 'none' ) ;
485- expect ( weekElement . css ( 'display' ) ) . toBe ( 'none' ) ;
484+ expect ( weekHeader ) . toBeHidden ( ) ;
485+ expect ( weekElement ) . toBeHidden ( ) ;
486486 } ) ;
487487
488488 it ( 'toggles week numbers' , function ( ) {
489489 $rootScope . showWeeks = true ;
490490 $rootScope . $digest ( ) ;
491491 expect ( weekHeader . text ( ) ) . toEqual ( '#' ) ;
492- expect ( weekHeader . css ( 'display' ) ) . not . toBe ( 'none' ) ;
493- expect ( weekElement . css ( 'display' ) ) . not . toBe ( 'none' ) ;
492+ expect ( weekHeader ) . not . toBeHidden ( ) ;
493+ expect ( weekElement ) . not . toBeHidden ( ) ;
494494
495495 $rootScope . showWeeks = false ;
496496 $rootScope . $digest ( ) ;
497497 expect ( weekHeader . text ( ) ) . toEqual ( '#' ) ;
498- expect ( weekHeader . css ( 'display' ) ) . toBe ( 'none' ) ;
499- expect ( weekElement . css ( 'display' ) ) . toBe ( 'none' ) ;
498+ expect ( weekHeader ) . toBeHidden ( ) ;
499+ expect ( weekElement ) . toBeHidden ( ) ;
500500 } ) ;
501501 } ) ;
502502
503503 describe ( 'min attribute' , function ( ) {
504504 beforeEach ( function ( ) {
505505 $rootScope . mindate = new Date ( "September 12, 2010" ) ;
506- element = $compile ( '<datepicker ng-model="$parent. date" min="mindate"></datepicker>' ) ( $rootScope ) ;
506+ element = $compile ( '<datepicker ng-model="date" min="mindate"></datepicker>' ) ( $rootScope ) ;
507507 $rootScope . $digest ( ) ;
508508 } ) ;
509509
@@ -598,7 +598,7 @@ describe('datepicker directive', function () {
598598 describe ( 'max attribute' , function ( ) {
599599 beforeEach ( function ( ) {
600600 $rootScope . maxdate = new Date ( "September 25, 2010" ) ;
601- element = $compile ( '<datepicker ng-model="$parent. date" max="maxdate"></datepicker>' ) ( $rootScope ) ;
601+ element = $compile ( '<datepicker ng-model="date" max="maxdate"></datepicker>' ) ( $rootScope ) ;
602602 $rootScope . $digest ( ) ;
603603 } ) ;
604604
@@ -688,7 +688,7 @@ describe('datepicker directive', function () {
688688 describe ( 'date-disabled expression' , function ( ) {
689689 beforeEach ( function ( ) {
690690 $rootScope . dateDisabledHandler = jasmine . createSpy ( 'dateDisabledHandler' ) ;
691- element = $compile ( '<datepicker ng-model="$parent. date" date-disabled="dateDisabledHandler(date, mode)"></datepicker>' ) ( $rootScope ) ;
691+ element = $compile ( '<datepicker ng-model="date" date-disabled="dateDisabledHandler(date, mode)"></datepicker>' ) ( $rootScope ) ;
692692 $rootScope . $digest ( ) ;
693693 } ) ;
694694
@@ -712,7 +712,7 @@ describe('datepicker directive', function () {
712712
713713 describe ( 'formatting attributes' , function ( ) {
714714 beforeEach ( function ( ) {
715- element = $compile ( '<datepicker ng-model="$parent. date" day-format="\'d\'" day-header-format="\'EEEE\'" day-title-format="\'MMMM, yy\'" month-format="\'MMM\'" month-title-format="\'yy\'" year-format="\'yy\'" year-range="10"></datepicker>' ) ( $rootScope ) ;
715+ element = $compile ( '<datepicker ng-model="date" day-format="\'d\'" day-header-format="\'EEEE\'" day-title-format="\'MMMM, yy\'" month-format="\'MMM\'" month-title-format="\'yy\'" year-format="\'yy\'" year-range="10"></datepicker>' ) ( $rootScope ) ;
716716 $rootScope . $digest ( ) ;
717717 } ) ;
718718
@@ -771,7 +771,7 @@ describe('datepicker directive', function () {
771771 datepickerConfig . dayTitleFormat = 'MMMM, yy' ;
772772 datepickerConfig . monthTitleFormat = 'yy' ;
773773
774- element = $compile ( '<datepicker ng-model="$parent. date"></datepicker>' ) ( $rootScope ) ;
774+ element = $compile ( '<datepicker ng-model="date"></datepicker>' ) ( $rootScope ) ;
775775 $rootScope . $digest ( ) ;
776776 } ) ) ;
777777 afterEach ( inject ( function ( datepickerConfig ) {
@@ -817,10 +817,10 @@ describe('datepicker directive', function () {
817817 } ) ;
818818
819819 it ( 'changes initial visibility for weeks' , function ( ) {
820- expect ( getLabelsRow ( ) . find ( 'th' ) . eq ( 0 ) . css ( 'display' ) ) . toBe ( 'none' ) ;
820+ expect ( getLabelsRow ( ) . find ( 'th' ) . eq ( 0 ) ) . toBeHidden ( ) ;
821821 var tr = element . find ( 'tbody' ) . find ( 'tr' ) ;
822822 for ( var i = 0 ; i < 5 ; i ++ ) {
823- expect ( tr . eq ( i ) . find ( 'td' ) . eq ( 0 ) . css ( 'display' ) ) . toBe ( 'none' ) ;
823+ expect ( tr . eq ( i ) . find ( 'td' ) . eq ( 0 ) ) . toBeHidden ( ) ;
824824 }
825825 } ) ;
826826
@@ -981,12 +981,12 @@ describe('datepicker directive', function () {
981981 } ) ;
982982
983983 it ( 'does not to display datepicker initially' , function ( ) {
984- expect ( dropdownEl . css ( 'display' ) ) . toBe ( 'none' ) ;
984+ expect ( dropdownEl ) . toBeHidden ( ) ;
985985 } ) ;
986986
987987 it ( 'displays datepicker on input focus' , function ( ) {
988988 inputEl . focus ( ) ;
989- expect ( dropdownEl . css ( 'display' ) ) . not . toBe ( 'none' ) ;
989+ expect ( dropdownEl ) . not . toBeHidden ( ) ;
990990 } ) ;
991991
992992 it ( 'renders the calendar correctly' , function ( ) {
@@ -1216,7 +1216,7 @@ describe('datepicker directive', function () {
12161216 } ) ;
12171217
12181218 it ( 'should hide bar' , function ( ) {
1219- expect ( buttonBarElement . css ( 'display' ) ) . toBe ( 'none' ) ;
1219+ expect ( buttonBarElement ) . toBeHidden ( ) ;
12201220 } ) ;
12211221 } ) ;
12221222
@@ -1342,10 +1342,10 @@ describe('datepicker directive', function () {
13421342 } ) ) ;
13431343
13441344 it ( 'changes initial visibility for weeks' , function ( ) {
1345- expect ( getLabelsRow ( ) . find ( 'th' ) . eq ( 0 ) . css ( 'display' ) ) . toBe ( 'none' ) ;
1345+ expect ( getLabelsRow ( ) . find ( 'th' ) . eq ( 0 ) ) . toBeHidden ( ) ;
13461346 var tr = element . find ( 'tbody' ) . find ( 'tr' ) ;
13471347 for ( var i = 0 ; i < 5 ; i ++ ) {
1348- expect ( tr . eq ( i ) . find ( 'td' ) . eq ( 0 ) . css ( 'display' ) ) . toBe ( 'none' ) ;
1348+ expect ( tr . eq ( i ) . find ( 'td' ) . eq ( 0 ) ) . toBeHidden ( ) ;
13491349 }
13501350 } ) ;
13511351 } ) ;
@@ -1354,7 +1354,7 @@ describe('datepicker directive', function () {
13541354 describe ( 'datepicker directive with empty initial state' , function ( ) {
13551355 beforeEach ( inject ( function ( ) {
13561356 $rootScope . date = null ;
1357- element = $compile ( '<datepicker ng-model="$parent. date"></datepicker>' ) ( $rootScope ) ;
1357+ element = $compile ( '<datepicker ng-model="date"></datepicker>' ) ( $rootScope ) ;
13581358 $rootScope . $digest ( ) ;
13591359 } ) ) ;
13601360
0 commit comments