Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download src/utils/__tests__/tabUrl.test.ts from lerobot/visualize_dataset: direct link, hf CLI and curl.
- Browser
- Download file 843 Bytes
-
https://huggingface.co/spaces/lerobot/visualize_dataset/resolve/main/src/utils/__tests__/tabUrl.test.ts
- Command line
-
hf download hf://spaces/lerobot/visualize_dataset/src/utils/__tests__/tabUrl.test.ts
-
curl -L -o tabUrl.test.ts https://huggingface.co/spaces/lerobot/visualize_dataset/resolve/main/src/utils/__tests__/tabUrl.test.ts
843 Bytes
| import { describe, expect, test } from "bun:test"; | |
| import { searchWithTab } from "@/utils/tabUrl"; | |
| describe("searchWithTab", () => { | |
| test("names a non-default tab", () => { | |
| expect(searchWithTab("", "filtering", "episodes")).toBe("?tab=filtering"); | |
| }); | |
| test("leaves the default tab out", () => { | |
| expect(searchWithTab("?tab=filtering", "episodes", "episodes")).toBe(""); | |
| }); | |
| test("keeps the other parameters", () => { | |
| expect(searchWithTab("?t=12&__theme=dark", "frames", "episodes")).toBe( | |
| "?t=12&__theme=dark&tab=frames", | |
| ); | |
| expect(searchWithTab("?t=12&tab=frames", "episodes", "episodes")).toBe( | |
| "?t=12", | |
| ); | |
| }); | |
| test("replaces a stale tab, including the legacy 3D Replay id", () => { | |
| expect(searchWithTab("?tab=urdf", "replay", "episodes")).toBe( | |
| "?tab=replay", | |
| ); | |
| }); | |
| }); | |