Download packages/app/src/pages/session/file-tab-scroll.test.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 965 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/pages/session/file-tab-scroll.test.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/src/pages/session/file-tab-scroll.test.ts
-
curl -L -o file-tab-scroll.test.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/pages/session/file-tab-scroll.test.ts
965 Bytes
| import { describe, expect, test } from "bun:test" | |
| import { nextTabListScrollLeft } from "./file-tab-scroll" | |
| describe("nextTabListScrollLeft", () => { | |
| test("does not scroll when width shrinks", () => { | |
| const left = nextTabListScrollLeft({ | |
| prevScrollWidth: 500, | |
| scrollWidth: 420, | |
| clientWidth: 300, | |
| prevContextOpen: false, | |
| contextOpen: false, | |
| }) | |
| expect(left).toBeUndefined() | |
| }) | |
| test("scrolls to start when context tab opens", () => { | |
| const left = nextTabListScrollLeft({ | |
| prevScrollWidth: 400, | |
| scrollWidth: 500, | |
| clientWidth: 320, | |
| prevContextOpen: false, | |
| contextOpen: true, | |
| }) | |
| expect(left).toBe(0) | |
| }) | |
| test("scrolls to right edge for new file tabs", () => { | |
| const left = nextTabListScrollLeft({ | |
| prevScrollWidth: 500, | |
| scrollWidth: 780, | |
| clientWidth: 300, | |
| prevContextOpen: true, | |
| contextOpen: true, | |
| }) | |
| expect(left).toBe(480) | |
| }) | |
| }) | |