Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Essential Angular

You're reading from  Essential Angular

Product type Book
Published in May 2017
Publisher Packt
ISBN-13 9781788293761
Pages 108 pages
Edition 1st Edition
Languages
Authors (3):
Narwhal Technologies Inc Narwhal Technologies Inc
Author Profile Icon Narwhal Technologies Inc
Narwhal Technologies Inc
Jeff Cross Jeff Cross
Author Profile Icon Jeff Cross
Jeff Cross
Victor Savkin Victor Savkin
Author Profile Icon Victor Savkin
Victor Savkin
View More author details
Toc

Integration testing

We can also write an integration test that will exercise the whole application.

import {TestBed, async, ComponentFixture, inject} from '@angular/core/testing';
import {AppCmp} from './app.component';
import {AppModule} from './app.module';
import {App} from "./app";

describe('AppCmp', () => {
let component: AppCmp;
let fixture: ComponentFixture<AppCmp>;
let el: Element;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [AppModule]
});
TestBed.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AppCmp);
component = fixture.componentInstance;
fixture.detectChanges();
el = fixture.debugElement.nativeElement;
});

it('should filter talks by title', async(inject([App], \
(app: App) => {
app.model.talks = [
{
"id": 1,
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime