Download __tests__/utils/mobile-section-nav.test.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 1.5 kB
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/utils/mobile-section-nav.test.ts
- Command line
-
hf download hf://SaylorTwift/openhands/__tests__/utils/mobile-section-nav.test.ts
-
curl -L -o mobile-section-nav.test.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/utils/mobile-section-nav.test.ts
1.5 kB
| import { describe, expect, it } from "vitest"; | |
| import { getMobileTopBarState } from "#/utils/mobile-section-nav"; | |
| import { I18nKey } from "#/i18n/declaration"; | |
| describe("getMobileTopBarState", () => { | |
| it("shows menu on settings and customize hubs", () => { | |
| expect(getMobileTopBarState("/settings")).toEqual({ mode: "menu" }); | |
| expect(getMobileTopBarState("/customize")).toEqual({ mode: "menu" }); | |
| }); | |
| it("backs from settings detail pages to the settings hub", () => { | |
| expect(getMobileTopBarState("/settings/llm")).toEqual({ | |
| mode: "back", | |
| backTo: "/settings", | |
| backLabelKey: I18nKey.SETTINGS$TITLE, | |
| }); | |
| }); | |
| it("backs from extension detail pages to the customize hub", () => { | |
| expect(getMobileTopBarState("/skills")).toEqual({ | |
| mode: "back", | |
| backTo: "/customize", | |
| backLabelKey: I18nKey.NAV$CUSTOMIZE, | |
| }); | |
| expect(getMobileTopBarState("/mcp")).toEqual({ | |
| mode: "back", | |
| backTo: "/customize", | |
| backLabelKey: I18nKey.NAV$CUSTOMIZE, | |
| }); | |
| }); | |
| it("backs from the apps management page but not extension pages", () => { | |
| expect(getMobileTopBarState("/apps")).toEqual({ | |
| mode: "back", | |
| backTo: "/customize", | |
| backLabelKey: I18nKey.NAV$CUSTOMIZE, | |
| }); | |
| expect(getMobileTopBarState("/extensions/demo-page/hello")).toEqual({ | |
| mode: "menu", | |
| }); | |
| }); | |
| it("shows menu on main app routes", () => { | |
| expect(getMobileTopBarState("/conversations")).toEqual({ mode: "menu" }); | |
| }); | |
| }); | |