Guest User

Untitled

a guest
Nov 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import { MockComponent } from 'ng2-mock-component';
  2. import { By } from '@angular/platform-browser';
  3.  
  4. describe('ImgGalleryComponent', () => {
  5. beforeEach(async(() => {
  6. TestBed.configureTestingModule({
  7. declarations: [
  8. ImgGalleryComponent,
  9. MockComponent({selector: 'app-img-carousel', inputs: ['images', 'currentSlide', 'isFullscreen']})
  10. ]
  11. })
  12. .compileComponents();
  13. }));
  14.  
  15. // ... more setup
  16.  
  17. it('should contain a carousel', () => {
  18. const carousel = fixture.debugElement.query(By.css('app-img-carousel'))
  19. expect(carousel).toBeTruthy();
  20.  
  21. const carouselComponent = carousel.componentInstance;
  22. expect(carouselComponent.isFullscreen).toBe(true);
  23. expect(carouselComponent.images.length).toBe(3);
  24. expect(carouselComponent.currentSlide).toBe(0);
  25. });
  26. });
Add Comment
Please, Sign In to add comment