Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CP/Breadcrumbs/Breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static function push(Breadcrumb $breadcrumb)

public static function build(): array
{
$breadcrumbs = Nav::build(preferences: false)->map(function (array $section): ?array {
$breadcrumbs = Nav::build()->map(function (array $section): ?array {
$primaryNavItem = $section['items']->first(function (NavItem $navItem) {
return $navItem->isActive();
});
Expand Down
15 changes: 10 additions & 5 deletions tests/CP/Breadcrumbs/BreadcrumbsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function it_builds_breadcrumbs_correctly_for_content_show_page()
}

#[Test]
public function it_ignores_nav_preferences_when_building_breadcrumbs()
public function it_uses_nav_preferences_when_building_breadcrumbs()
{
$this->actingAs($user = User::make()->makeSuper())->get(cp_route('dashboard'));

Expand All @@ -125,13 +125,18 @@ public function it_ignores_nav_preferences_when_building_breadcrumbs()

$breadcrumbs = Breadcrumbs::build();

// None of the preferences should be applied to the breadcrumbs.
$this->assertEquals([
new Breadcrumb(
text: 'Dashboard',
text: 'The Dashboard',
url: 'http://localhost/cp/dashboard',
icon: 'dashboard',
links: []
icon: 'browser-com',
links: [
['icon' => 'collections', 'text' => 'Collections', 'url' => 'http://localhost/cp/collections'],
['icon' => 'navigation', 'text' => 'Navigation', 'url' => 'http://localhost/cp/navigation'],
['icon' => 'taxonomies', 'text' => 'Taxonomies', 'url' => 'http://localhost/cp/taxonomies'],
['icon' => 'assets', 'text' => 'Assets', 'url' => 'http://localhost/cp/assets'],
['icon' => 'globals', 'text' => 'Globals', 'url' => 'http://localhost/cp/globals'],
]
),
], $breadcrumbs);
}
Expand Down
Loading