Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { MockComponent } from 'ng2-mock-component';
- import { By } from '@angular/platform-browser';
- describe('ImgGalleryComponent', () => {
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [
- ImgGalleryComponent,
- MockComponent({selector: 'app-img-carousel', inputs: ['images', 'currentSlide', 'isFullscreen']})
- ]
- })
- .compileComponents();
- }));
- // ... more setup
- it('should contain a carousel', () => {
- const carousel = fixture.debugElement.query(By.css('app-img-carousel'))
- expect(carousel).toBeTruthy();
- const carouselComponent = carousel.componentInstance;
- expect(carouselComponent.isFullscreen).toBe(true);
- expect(carouselComponent.images.length).toBe(3);
- expect(carouselComponent.currentSlide).toBe(0);
- });
- });
Add Comment
Please, Sign In to add comment