@@ -12,7 +12,6 @@ describe('MatCalendarBody', () => {
12
12
13
13
// Test components.
14
14
StandardCalendarBody ,
15
- CalendarBodyWithDisabledCells ,
16
15
] ,
17
16
} ) ;
18
17
@@ -101,37 +100,6 @@ describe('MatCalendarBody', () => {
101
100
} ) ;
102
101
} ) ;
103
102
104
- describe ( 'calendar body with disabled cells' , ( ) => {
105
- let fixture : ComponentFixture < CalendarBodyWithDisabledCells > ;
106
- let testComponent : CalendarBodyWithDisabledCells ;
107
- let calendarBodyNativeElement : Element ;
108
- let cellEls : HTMLElement [ ] ;
109
-
110
- beforeEach ( ( ) => {
111
- fixture = TestBed . createComponent ( CalendarBodyWithDisabledCells ) ;
112
- fixture . detectChanges ( ) ;
113
-
114
- const calendarBodyDebugElement = fixture . debugElement . query ( By . directive ( MatCalendarBody ) ) ;
115
- calendarBodyNativeElement = calendarBodyDebugElement . nativeElement ;
116
- testComponent = fixture . componentInstance ;
117
- cellEls = Array . from ( calendarBodyNativeElement . querySelectorAll ( '.mat-calendar-body-cell' ) ) ;
118
- } ) ;
119
-
120
- it ( 'should only allow selection of disabled cells when allowDisabledSelection is true' , ( ) => {
121
- cellEls [ 0 ] . click ( ) ;
122
- fixture . detectChanges ( ) ;
123
-
124
- expect ( testComponent . selected ) . toBeFalsy ( ) ;
125
-
126
- testComponent . allowDisabledSelection = true ;
127
- fixture . detectChanges ( ) ;
128
-
129
- cellEls [ 0 ] . click ( ) ;
130
- fixture . detectChanges ( ) ;
131
-
132
- expect ( testComponent . selected ) . toBe ( 1 ) ;
133
- } ) ;
134
- } ) ;
135
103
} ) ;
136
104
137
105
@@ -160,25 +128,6 @@ class StandardCalendarBody {
160
128
}
161
129
}
162
130
163
-
164
- @Component ( {
165
- template : `<table mat-calendar-body
166
- [rows]="rows"
167
- [allowDisabledSelection]="allowDisabledSelection"
168
- (selectedValueChange)="selected = $event">
169
- </table>`
170
- } )
171
- class CalendarBodyWithDisabledCells {
172
- rows = [ [ 1 , 2 , 3 , 4 ] ] . map ( r => r . map ( d => {
173
- let cell = createCell ( d ) ;
174
- cell . enabled = d % 2 == 0 ;
175
- return cell ;
176
- } ) ) ;
177
- allowDisabledSelection = false ;
178
- selected : number ;
179
- }
180
-
181
-
182
131
function createCell ( value : number ) {
183
132
return new MatCalendarCell ( value , `${ value } ` , `${ value } -label` , true ) ;
184
133
}
0 commit comments