MCPcopy Create free account
hub / github.com/angular/angular / createSnapshotPairWithParent

Function createSnapshotPairWithParent

packages/router/test/router_state.spec.ts:131–152  ·  view source on GitHub ↗
(
      params: [Params, Params],
      parentParams: [Params, Params],
      urls: [string, string],
    )

Source from the content-addressed store, hash-verified

129 }
130
131 function createSnapshotPairWithParent(
132 params: [Params, Params],
133 parentParams: [Params, Params],
134 urls: [string, string],
135 ): [ActivatedRouteSnapshot, ActivatedRouteSnapshot] {
136 const snapshot1 = createSnapshot(params[0], []);
137 const snapshot2 = createSnapshot(params[1], []);
138
139 const snapshot1Parent = createSnapshot(parentParams[0], [new UrlSegment(urls[0], {})]);
140 const snapshot2Parent = createSnapshot(parentParams[1], [new UrlSegment(urls[1], {})]);
141
142 (snapshot1 as any)._routerState = new (RouterStateSnapshot as any)(
143 '',
144 new TreeNode(snapshot1Parent, [new TreeNode(snapshot1, [])]),
145 );
146 (snapshot2 as any)._routerState = new (RouterStateSnapshot as any)(
147 '',
148 new TreeNode(snapshot2Parent, [new TreeNode(snapshot2, [])]),
149 );
150
151 return [snapshot1, snapshot2];
152 }
153
154 it('should return false when params are different', () => {
155 expect(

Callers 1

Calls 1

createSnapshotFunction · 0.85

Tested by

no test coverage detected