Skip to content

Commit a45f3ee

Browse files
author
Tobias Schweizer
committed
tests (MatCalendar): fix tests
1 parent 46b2c9d commit a45f3ee

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/lib/datepicker/calendar.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,24 @@ import {
55
import {dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent} from '@angular/cdk/testing';
66
import {Component} from '@angular/core';
77
import {ComponentFixture, TestBed, async, inject} from '@angular/core/testing';
8-
import {DEC, FEB, JAN, MatNativeDateModule, NOV} from '@angular/material/core';
8+
import {DEC, FEB, JAN, NOV} from '@angular/material/core';
99
import {By} from '@angular/platform-browser';
1010
import {Direction, Directionality} from '@angular/cdk/bidi';
11-
import {MatButtonModule} from '../button/index';
1211
import {MatCalendar} from './calendar';
1312
import {MatCalendarBody} from './calendar-body';
1413
import {MatDatepickerIntl} from './datepicker-intl';
1514
import {MatMonthView} from './month-view';
1615
import {MatMultiYearView, yearsPerPage} from './multi-year-view';
1716
import {MatYearView} from './year-view';
18-
17+
import {MatDatepickerModule} from './datepicker-module';
1918

2019
describe('MatCalendar', () => {
2120
let dir: {value: Direction};
2221

2322
beforeEach(async(() => {
2423
TestBed.configureTestingModule({
2524
imports: [
26-
MatButtonModule,
27-
MatNativeDateModule,
25+
MatDatepickerModule,
2826
],
2927
declarations: [
3028
MatCalendar,

src/lib/datepicker/calendar.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ import {MatDatepickerIntl} from './datepicker-intl';
2929
import {MatMonthView} from './month-view';
3030
import {MatMultiYearView, yearsPerPage} from './multi-year-view';
3131
import {MatYearView} from './year-view';
32-
import {Directionality} from '@angular/cdk/bidi';
3332
import {ComponentPortal, ComponentType, Portal} from '@angular/cdk/portal';
3433

3534
/** Default header for MatCalendar */
3635
@Component({
36+
moduleId: module.id,
3737
selector: 'mat-calendar-header',
38-
template: 'default header'
38+
template: 'default header',
39+
encapsulation: ViewEncapsulation.None,
40+
preserveWhitespaces: false,
41+
changeDetection: ChangeDetectionStrategy.OnPush,
3942
})
4043
export class MatCalendarHeader {
4144
constructor() {

0 commit comments

Comments
 (0)