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

Function createSnapshotPairWithParent

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

createSnapshotFunction · 0.85

Tested by

no test coverage detected