~~~ fix some tests

This commit is contained in:
Jason Choi
2016-08-16 12:03:45 -07:00
parent 23a942ddec
commit 884cf2df33
2 changed files with 250 additions and 244 deletions

View File

@ -41,7 +41,8 @@ export function main() {
platformDynamicServer().bootstrapModule(ExampleModule).then(() => {
expect(getDOM().getText(body)).toEqual('Works!');
});
}));
}),
500);
});
}

View File

@ -11,6 +11,7 @@ import 'rxjs/add/operator/map';
import {CommonModule, Location} from '@angular/common';
import {Component, NgModule, NgModuleFactoryLoader} from '@angular/core';
import {ComponentFixture, TestBed, fakeAsync, inject, tick} from '@angular/core/testing';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {expect} from '@angular/platform-browser/testing/matchers';
import {Observable} from 'rxjs/Observable';
import {of } from 'rxjs/observable/of';
@ -632,6 +633,7 @@ describe('Integration', () => {
})));
});
if (getDOM().supportsDOMEvents()) { // Browser only
describe('router links', () => {
it('should support string router links', fakeAsync(inject([Router], (router: Router) => {
const fixture = createRoot(router, RootCmp);
@ -828,6 +830,7 @@ describe('Integration', () => {
expect(location.path()).toEqual('/team/22/simple?q=1#f');
})));
});
}
describe('redirects', () => {
it('should work', fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
@ -1350,6 +1353,7 @@ describe('Integration', () => {
});
});
if (getDOM().supportsDOMEvents()) { // Browser only
describe('routerActiveLink', () => {
it('should set the class when the link is active (a tag)',
fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
@ -1463,6 +1467,7 @@ describe('Integration', () => {
})));
});
}
describe('lazy loading', () => {
it('works', fakeAsync(inject(