You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: breadcrumb_test.go
    path of file: ./repos/octant/internal/api
    
    the code of the file until where you have to start completion: /*
 * Copyright (c) 2020 the Octant contributors. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package api_test

import (
	"io/ioutil"
	"path/filepath"
	"testing"

	"github.com/stretchr/testify/require"

	"github.com/vmware-tanzu/octant/internal/api"
	"github.com/vmware-tanzu/octant/internal/util/json"
	"github.com/vmware-tanzu/octant/pkg/navigation"
	"github.com/vmware-tanzu/octant/pkg/view/component"
)

func Test_NavigationFromPathNamespace(t *testing.T) {
	tests := []struct {
		name              string
		path              string
		parentTitle       string
		parentUrl         string
		expectedTitle     string
		expectedSelection string
		expectedItems     int
	}{
		{
			name:          "Namespace Overview (root level)",
			path:          "overview/namespace/milan",
			expectedItems: 0,
		},
		{
			name:              "Config and Storage (1st level)",
			path:              "overview/namespace/milan/config-and-storage",
			parentTitle:       "Namespace Overview",
			parentUrl:         "overview/namespace/milan",
			expectedTitle:     "Namespace Overview",
			expectedSelection: "Config and Storage",
			expectedItems:     7,
		},
		{
			name:              "Config Maps (2nd level)",
			path:              "overview/namespace/milan/config-and-storage/config-maps",
			parentTitle:       "Config and Storage",
			parentUrl:         "overview/namespace/milan/config-and-storage",
			expectedTitle:     "Config Maps",
			expectedSelection: "Config Maps",
			expectedItems:     4,
		},
		{
			name:          "Specific Config Map (3rd level)",
			path:          "overview/namespace/milan/config-and-storage/config-maps/kafka-config",
			expectedItems: 0,
		},
		{
			name:              "Custom Resources (1st level)",
			path:              "overview/namespace/milan/custom-resources",
			parentTitle:       "Namespace Overview",
			parentUrl:         "overview/namespace/milan",
			expectedTitle:     "Namespace Overview",
			expectedSelection: "Custom Resources",
			expectedItems:     7,
		},
		{
			name:              "Custom Resources (2nd level)",
			path:              "overview/namespace/milan/custom-resources/brokers.eventing.knative.dev",
			parentTitle:       "Custom Resources",
			parentUrl:         "overview/namespace/milan/custom-resources",
			expectedTitle:     "brokers.eventing.knative.dev",
			expectedSelection: "brokers.eventing.knative.dev",
			expectedItems:     2,
		},
		{
			name:          "Custom Resources (3rd level)",
			path:          "overview/namespace/milan/custom-resources/brokers.eventing.knative.dev/default",
			expectedItems: 0,
		},
		{
			name:              "Events (1st level no children)",
			path:              "overview/namespace/milan/events",
			parentTitle:       "Namespace Overview",
			parentUrl:         "overview/namespace/milan",
			expectedTitle:     "Namespace Overview",
			expectedSelection: "Events",
			expectedItems:     7,
		},
		{
			name:          "Specific Event (2nd level)",
			path:          "overview/namespace/milan/events/kafka-0.16501e3e90730f40",
			expectedItems: 0,
		},
	}
	data, err := ioutil.ReadFile(filepath.Join("test
    
func Test_NavigationFromPathCluster(t *testing.T) {
	tests := []struct {
		name              string
		path              string
		parentTitle       string
		parentUrl         string
		expectedTitle     string
		expectedSelection string
		expectedItems     int
	}{
		{
			name:          "Cluster Overview (Root)",
			path:          "cluster-overview",
			expectedTitle: "",
			expectedItems: 0,
		},
		{
			name:              "Webhooks (1st level)",
			path:              "cluster-overview/webhooks",
			parentTitle:       "Cluster Overview",
			parentUrl:         "cluster-overview",
			expectedTitle:     "Cluster Overview",
			expectedSelection: "Webhooks",
			expectedItems:     9,
		},
		{
			name:              "Mutating Webhooks (2nd level)",
			path:              "cluster-overview/webhooks/mutating-webhooks",
			parentTitle:       "Webhooks",
			parentUrl:         "cluster-overview/webhooks",
			expectedTitle:     "Mutating Webhooks",
			expectedSelection: "Mutating Webhooks",
			expectedItems:     2,
		},
		{
			name:          "Specific Webhook (3rd level)",
			path:          "cluster-overview/webhooks/mutating-webhooks/cert-manager-webhook",
			expectedTitle: "",
			expectedItems: 0,
		},
		{
			name:              "Custom Resources (1st level)",
			path:              "cluster-overview/custom-resources",
			parentTitle:       "Cluster Overview",
			parentUrl:         "cluster-overview",
			expectedTitle:     "Cluster Overview",
			expectedSelection: "Custom Resources",
			expectedItems:     9,
		},
		{
			name:              "Custom Resources (2nd level)",
			path:              "cluster-overview/custom-resources/storagestates.migration.k8s.io",
			parentTitle:       "Custom Resources",
			parentUrl:         "cluster-overview/custom-resources",
			expectedTitle:     "clusterissuers.cert-manager.io",
			expectedSelection: "storagestates.migration.k8s.io",
			expectedItems:     7,
		},
		{
			name:              "Namespaces (1st level no children)",
			path:              "cluster-overview/namespaces",
			parentTitle:       "Cluster Overview",
			parentUrl:         "cluster-overview",
			expectedTitle:     "Cluster Overview",
			expectedSelection: "Namespaces",
			expectedItems:     9,
		},
		{
			name:          "Specific Namespace (2nd level)",
			path:          "cluster-overview/namespaces/milan",
			expectedItems: 0,
		},
	}
	data, err := ioutil.ReadFile(filepath.Join("testdata", "cluster_navigation.json"))
	require.NoError(t, err)
	var namespaceNavigation []navigation.Navigation

	err = json.Unmarshal([]byte(data), &namespaceNavigation)
	require.NoError(t, err)
	require.Equal(t, 9, len(namespaceNavigation))

	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			nav, parent, selection := api.NavigationFromPath(namespaceNavigation, test.path)
			require.NotNil(t, nav)
			require.Equal(t, test.expectedItems, len(nav))
			require.Equal(t, test.parentTitle, parent.Title)
			require.Equal(t, test.parentUrl, parent.Url)
			if test.expectedItems > 0 {
				require.Equal(t, test.expectedTitle, nav[0].Title)
				require.Equal(t, test.expectedSelection, selection.Title)
			}
		})
	}
}