build: add bazel test rules for remainder of packages (#21053)
PR Close #21053
This commit is contained in:
@ -31,7 +31,7 @@ describe('Router', () => {
|
||||
const r: Router = TestBed.get(Router);
|
||||
const root = r.routerState.root;
|
||||
|
||||
r.resetRootComponentType(NewRootComponent);
|
||||
(r as any).resetRootComponentType(NewRootComponent);
|
||||
|
||||
expect(r.routerState.root).toBe(root);
|
||||
});
|
||||
@ -103,7 +103,7 @@ describe('Router', () => {
|
||||
let result = false;
|
||||
const childSnapshot =
|
||||
createActivatedRouteSnapshot({component: 'child', routeConfig: {path: 'child'}});
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url', new TreeNode(empty.root, [new TreeNode(childSnapshot, [])]));
|
||||
|
||||
const p = new PreActivation(futureState, empty, TestBed, (evt) => { events.push(evt); });
|
||||
@ -132,7 +132,7 @@ describe('Router', () => {
|
||||
{component: 'grandchild', routeConfig: {path: 'grandchild'}});
|
||||
const greatGrandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'great-grandchild', routeConfig: {path: 'great-grandchild'}});
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [
|
||||
@ -164,9 +164,9 @@ describe('Router', () => {
|
||||
createActivatedRouteSnapshot({component: 'child', routeConfig: {path: 'child'}});
|
||||
const grandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'grandchild', routeConfig: {path: 'grandchild'}});
|
||||
const currentState = new RouterStateSnapshot(
|
||||
const currentState = new (RouterStateSnapshot as any)(
|
||||
'url', new TreeNode(empty.root, [new TreeNode(childSnapshot, [])]));
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
@ -203,11 +203,11 @@ describe('Router', () => {
|
||||
{component: 'greatgrandchild', routeConfig: {path: 'greatgrandchild'}});
|
||||
const greatGreatGrandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'great-greatgrandchild', routeConfig: {path: 'great-greatgrandchild'}});
|
||||
const currentState = new RouterStateSnapshot(
|
||||
const currentState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root,
|
||||
@ -252,7 +252,7 @@ describe('Router', () => {
|
||||
const grandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'grandchild', routeConfig: {canActivate: [CA_GRANDCHILD]}});
|
||||
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
@ -279,7 +279,7 @@ describe('Router', () => {
|
||||
const grandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'grandchild', routeConfig: {canActivate: [CA_GRANDCHILD]}});
|
||||
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
@ -306,7 +306,7 @@ describe('Router', () => {
|
||||
const grandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'grandchild', routeConfig: {canActivate: [CA_GRANDCHILD]}});
|
||||
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
@ -337,10 +337,10 @@ describe('Router', () => {
|
||||
const grandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'grandchild', routeConfig: {canActivate: [CA_GRANDCHILD]}});
|
||||
|
||||
const currentState = new RouterStateSnapshot(
|
||||
const currentState = new (RouterStateSnapshot as any)(
|
||||
'prev', new TreeNode(empty.root, [new TreeNode(prevSnapshot, [])]));
|
||||
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
@ -368,9 +368,9 @@ describe('Router', () => {
|
||||
const grandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'grandchild', routeConfig: {canActivate: [CA_GRANDCHILD]}});
|
||||
|
||||
const currentState = new RouterStateSnapshot(
|
||||
const currentState = new (RouterStateSnapshot as any)(
|
||||
'prev', new TreeNode(empty.root, [new TreeNode(prevSnapshot, [])]));
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
@ -400,12 +400,12 @@ describe('Router', () => {
|
||||
const grandchildSnapshot = createActivatedRouteSnapshot(
|
||||
{component: 'grandchild', routeConfig: {canActivate: [CA_GRANDCHILD]}});
|
||||
|
||||
const currentState = new RouterStateSnapshot(
|
||||
const currentState = new (RouterStateSnapshot as any)(
|
||||
'prev', new TreeNode(empty.root, [
|
||||
new TreeNode(prevChildSnapshot, [new TreeNode(prevGrandchildSnapshot, [])])
|
||||
]));
|
||||
|
||||
const futureState = new RouterStateSnapshot(
|
||||
const futureState = new (RouterStateSnapshot as any)(
|
||||
'url',
|
||||
new TreeNode(
|
||||
empty.root, [new TreeNode(childSnapshot, [new TreeNode(grandchildSnapshot, [])])]));
|
||||
@ -435,7 +435,8 @@ describe('Router', () => {
|
||||
*/
|
||||
const r = {data: 'resolver'};
|
||||
const n = createActivatedRouteSnapshot({component: 'a', resolve: r});
|
||||
const s = new RouterStateSnapshot('url', new TreeNode(empty.root, [new TreeNode(n, [])]));
|
||||
const s = new (RouterStateSnapshot as any)(
|
||||
'url', new TreeNode(empty.root, [new TreeNode(n, [])]));
|
||||
|
||||
checkResolveData(s, empty, inj, () => {
|
||||
expect(s.root.firstChild !.data).toEqual({data: 'resolver_value'});
|
||||
@ -456,7 +457,7 @@ describe('Router', () => {
|
||||
const parent = createActivatedRouteSnapshot({component: null !, resolve: parentResolve});
|
||||
const child = createActivatedRouteSnapshot({component: 'b', resolve: childResolve});
|
||||
|
||||
const s = new RouterStateSnapshot(
|
||||
const s = new (RouterStateSnapshot as any)(
|
||||
'url', new TreeNode(empty.root, [new TreeNode(parent, [new TreeNode(child, [])])]));
|
||||
|
||||
const inj = {get: (token: any) => () => Promise.resolve(`${token}_value`)};
|
||||
@ -478,12 +479,13 @@ describe('Router', () => {
|
||||
const r2 = {data: 'resolver2'};
|
||||
|
||||
const n1 = createActivatedRouteSnapshot({component: 'a', resolve: r1});
|
||||
const s1 = new RouterStateSnapshot('url', new TreeNode(empty.root, [new TreeNode(n1, [])]));
|
||||
const s1 = new (RouterStateSnapshot as any)(
|
||||
'url', new TreeNode(empty.root, [new TreeNode(n1, [])]));
|
||||
checkResolveData(s1, empty, inj, () => {});
|
||||
|
||||
const n21 = createActivatedRouteSnapshot({component: 'a', resolve: r1});
|
||||
const n22 = createActivatedRouteSnapshot({component: 'b', resolve: r2});
|
||||
const s2 = new RouterStateSnapshot(
|
||||
const s2 = new (RouterStateSnapshot as any)(
|
||||
'url', new TreeNode(empty.root, [new TreeNode(n21, [new TreeNode(n22, [])])]));
|
||||
checkResolveData(s2, s1, inj, () => {
|
||||
expect(s2.root.firstChild !.data).toEqual({data: 'resolver1_value'});
|
||||
|
Reference in New Issue
Block a user