test(ivy): run router/upgrade tests with ivy on CI (#27410)

PR Close #27410
This commit is contained in:
Marc Laval 2018-12-03 12:14:54 +01:00 committed by Alex Rickabaugh
parent 6552471c49
commit 0cf49c8de3
2 changed files with 47 additions and 44 deletions

View File

@ -7,6 +7,7 @@ ts_library(
deps = [
"//packages/common",
"//packages/core/testing",
"//packages/private/testing",
"//packages/router",
"//packages/router/upgrade",
"//packages/upgrade/static",
@ -15,9 +16,6 @@ ts_library(
ts_web_test_suite(
name = "test_web",
tags = [
"fixme-ivy-aot",
],
deps = [
":test_lib",
],

View File

@ -8,6 +8,7 @@
import {Location} from '@angular/common';
import {TestBed} from '@angular/core/testing';
import {fixmeIvy} from '@angular/private/testing';
import {Router} from '@angular/router';
import {setUpLocationSync} from '@angular/router/upgrade';
import {UpgradeModule} from '@angular/upgrade/static';
@ -43,6 +44,7 @@ describe('setUpLocationSync', () => {
`);
});
fixmeIvy('FW-777: R3Injector doesn\'t support injectors as a provider') &&
it('should get the $rootScope from AngularJS and set an $on watch on $locationChangeStart',
() => {
const $rootScope = jasmine.createSpyObj('$rootScope', ['$on']);
@ -53,9 +55,11 @@ describe('setUpLocationSync', () => {
setUpLocationSync(upgradeModule);
expect($rootScope.$on).toHaveBeenCalledTimes(1);
expect($rootScope.$on).toHaveBeenCalledWith('$locationChangeStart', jasmine.any(Function));
expect($rootScope.$on)
.toHaveBeenCalledWith('$locationChangeStart', jasmine.any(Function));
});
fixmeIvy('FW-777: R3Injector doesn\'t support injectors as a provider') &&
it('should navigate by url every time $locationChangeStart is broadcasted', () => {
const url = 'https://google.com';
const pathname = '/custom/route';
@ -79,6 +83,7 @@ describe('setUpLocationSync', () => {
expect(RouterMock.navigateByUrl).toHaveBeenCalledWith(normalizedPathname + query + hash);
});
fixmeIvy('FW-777: R3Injector doesn\'t support injectors as a provider') &&
it('should work correctly on browsers that do not start pathname with `/`', () => {
const anchorProto = HTMLAnchorElement.prototype;
const originalDescriptor = Object.getOwnPropertyDescriptor(anchorProto, 'pathname');