(
-
-
-
-
- )}
- />
- ));
-
- expect(await screen.findByTitle("Application")).toBeInTheDocument();
- expect(await screen.findByTitle("Appearance")).toBeInTheDocument();
-
- await waitFor(() => {
- expect(queryByTitle("Kubectl")).not.toBeInTheDocument();
- });
- });
-
- it("expands parent sections", async () => {
- render((
- (
-
- )}
- />
- ));
-
- expect(await screen.findByTitle("Application")).toHaveAttribute("aria-expanded");
- expect(await screen.findByTitle("Kubernetes")).toHaveAttribute("aria-expanded");
- });
-
- it("skips sections without headings", async () => {
- render((
- (
-
- )}
- />
- ));
-
- expect(await screen.findByTitle("Application")).toBeInTheDocument();
-
- await waitFor(() => {
- expect(screen.queryByTitle("appearance")).not.toBeInTheDocument();
- expect(screen.queryByTitle("Appearance")).not.toBeInTheDocument();
- });
- });
-});
diff --git a/packages/core/src/renderer/components/scroll-spy/scroll-spy.tsx b/packages/core/src/renderer/components/scroll-spy/scroll-spy.tsx
index b31e1cc701..9fb763d607 100644
--- a/packages/core/src/renderer/components/scroll-spy/scroll-spy.tsx
+++ b/packages/core/src/renderer/components/scroll-spy/scroll-spy.tsx
@@ -6,7 +6,14 @@
import { observer } from "mobx-react";
import React, { useEffect, useRef, useState } from "react";
import { useMutationObserver } from "../../hooks";
-import type { NavigationTree } from "../tree-view";
+
+export interface NavigationTree {
+ id: string;
+ parentId?: string;
+ name: string;
+ selected?: boolean;
+ children?: NavigationTree[];
+}
export interface ScrollSpyProps extends React.DOMAttributes {
render: (data: NavigationTree[]) => JSX.Element;