diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..8f96769e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +sudo: required +dist: trusty +addons: + apt: + sources: + - google-chrome + packages: + - google-chrome-stable +language: node_js +node_js: + - "7" +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start +script: + - ng lint + - ng test --single-run + - ng build -prod + - ng e2e diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 7e033e0a..e64330a5 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -7,8 +7,8 @@ describe('rxjs-docs App', () => { page = new AppPage(); }); - it('should display welcome message', () => { + it('should display title', () => { page.navigateTo(); - expect(page.getParagraphText()).toEqual('Welcome to app!'); + expect(page.getPageTitle()).toEqual('RxJS Docs'); }); }); diff --git a/e2e/app.po.ts b/e2e/app.po.ts index 82ea75ba..4b4a55c9 100644 --- a/e2e/app.po.ts +++ b/e2e/app.po.ts @@ -5,7 +5,7 @@ export class AppPage { return browser.get('/'); } - getParagraphText() { - return element(by.css('app-root h1')).getText(); + getPageTitle() { + return element(by.css('span.title')).getText(); } } diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts new file mode 100644 index 00000000..dc143d2a --- /dev/null +++ b/src/app/app.component.spec.ts @@ -0,0 +1,28 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { MdToolbarModule, MdSidenavModule, MdIconModule, MdButtonModule, MdListModule } from '@angular/material'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + let component: AppComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [RouterTestingModule, BrowserAnimationsModule, MdToolbarModule, MdSidenavModule, MdIconModule, MdButtonModule, MdListModule], + declarations: [AppComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 55a562c0..916c2a22 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; class Menu { title: string; link: string; - options: { exact: boolean }; + options: { exact: boolean }; } @Component({ @@ -13,25 +13,25 @@ class Menu { }) export class AppComponent { menus: Menu[] = [ - { + { title: 'Home', link: '/', options: { exact: true } }, - { + { title: 'Operators', link: '/operators', options: { exact: false } }, - { + { title: 'Companies', link: '/companies', options: { exact: false } }, - { + { title: 'Team', link: '/team', options: { exact: false } } - ] + ]; }