Created
October 25, 2018 20:43
-
-
Save jotatoledo/ad7a6b18ec8d84a745bb492f2c2320ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class MatSidenavMock { | |
_animationStarted = new EventEmitter<AnimationEvent>(); | |
opened = false; | |
} | |
export class TdLayoutManageListComponentMock implements ILayoutTogglable { | |
get sidenav(): MatSidenav { | |
return <any>this.mockSidenav; | |
} | |
readonly mockSidenav = new MatSidenavMock(); | |
mode: "side" | "push" | "over"; | |
opened: boolean; | |
sidenavWidth: string; | |
readonly disableClose: boolean; | |
toggle(): Promise<MatDrawerToggleResult> { | |
return Promise.resolve(undefined); | |
} | |
open(): Promise<MatDrawerToggleResult> { | |
return Promise.resolve(undefined); | |
} | |
close(): Promise<MatDrawerToggleResult> { | |
return Promise.resolve(undefined); | |
} | |
} | |
describe("ContentComponent", () => { | |
let component: ContentComponent; | |
let fixture: ComponentFixture<ContentComponent>; | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
imports: [ | |
NoopAnimationsModule, | |
CommonModule, | |
MatToolbarModule, | |
MatButtonModule, | |
MatIconModule, | |
MatCardModule, | |
CovalentLayoutModule | |
], | |
declarations: [ContentComponent], | |
providers: [ | |
{ | |
provide: TdLayoutManageListComponent, | |
useClass: TdLayoutManageListComponentMock | |
} | |
] | |
}) | |
.compileComponents(); | |
})); | |
beforeEach(() => { | |
fixture = TestBed.createComponent(ContentComponent); | |
fixture.detectChanges(); | |
component = fixture.componentInstance; | |
}); | |
it("should create", () => { | |
expect(component).toBeTruthy(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment