Browse Source
Merge pull request #25695 from abpframework/auto-merge/rel-10-5/4678
Merge branch dev with rel-10.5
pull/25699/head
Volosoft Agent
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
16 additions and
1 deletions
-
npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts
-
npm/ng-packs/packages/theme-shared/src/lib/tests/breadcrumb.component.spec.ts
|
|
|
@ -44,7 +44,7 @@ export class BreadcrumbComponent implements OnInit { |
|
|
|
|
|
|
|
while (node.parent) { |
|
|
|
node = node.parent; |
|
|
|
const { parent, children, isLeaf, path, ...segment } = node; |
|
|
|
const { parent, children, isLeaf, ...segment } = node; |
|
|
|
if (!isAdministration(segment)) this.segments.unshift(segment); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -10,6 +10,7 @@ import { |
|
|
|
ConfigStateService, |
|
|
|
} from '@abp/ng.core'; |
|
|
|
import { RouterModule } from '@angular/router'; |
|
|
|
import { By } from '@angular/platform-browser'; |
|
|
|
import { createRoutingFactory, SpectatorRouting } from '@ngneat/spectator/vitest'; |
|
|
|
import { of } from 'rxjs'; |
|
|
|
import { BreadcrumbComponent, BreadcrumbItemsComponent } from '../components'; |
|
|
|
@ -118,4 +119,18 @@ describe('BreadcrumbComponent', () => { |
|
|
|
spectator.detectChanges(); |
|
|
|
expect(spectator.component).toBeTruthy(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should keep the path on segments so breadcrumbs render as links', async () => { |
|
|
|
routes.add(mockRoutes); |
|
|
|
await spectator.router.navigateByUrl('/identity/users'); |
|
|
|
spectator.detectChanges(); |
|
|
|
|
|
|
|
const breadcrumb = spectator.fixture.debugElement.query(By.directive(BreadcrumbComponent)) |
|
|
|
.componentInstance as BreadcrumbComponent; |
|
|
|
|
|
|
|
expect(breadcrumb.segments.map(segment => segment.path)).toEqual([ |
|
|
|
'/identity', |
|
|
|
'/identity/users', |
|
|
|
]); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|